cant seem to figure out panning with images

Albert Anderson bart_doggers at YAHOO.COM
Tue Jul 25 10:24:49 EDT 2006


Hi all,

 I am a javascript for panning with images.  I type in all the code but its not panning.  Here is part of the html code. Is there something wrong with my code?  I am using a projection image with an extent of 626173.309834 5085113.091715 694065.960556 5170035.212592.  The image set in a table size of 309px by 417px. Could someone give a some suggestions.  Thanks

Albert

<script type="text/javascript">
  var mapheight = 417;
  var mapwidth = 309;
  var pansize = 0.75;

function pan(direction) {
  var x,y;
  
 if(direction== 'n') {
   x = (309-1)/2.0;
   y = 0 - (417 * pansize)/2.0;
 } else if(direction== 'nw') {
   x = 0 - (309 * pansize)/2.0;
   y = 0 - (309 * pansize)/2.0;
 } else if(direction== 'ne') {
   x = (309-1) + (309 * pansize)/2.0;
   y = 0 - (417 * pansize)/2.0;
 } else if(direction== 's') {
   x = (309-1)/2.0;
   y = (417-1) + (417 * pansize)/2.0;
 } else if(direction== 'sw') {
   x = 0 - (309 * pansize)/2.0;
   y = (417-1) + (417 * pansize)/2.0;
 } else if(direction== 'se') {
   x = (309-1) + (309 * pansize)/2.0;
   y = (417-1) + (417 * pansize)/2.0;
 } else if(direction== 'e') {
   x = (309-1) + (309 * pansize)/2.0;
   y = (417-1)/2.0;
 } else if(direction== 'w') {
   x = 0 - (309 * pansize)/2.0;
   y = (417-1)/2.0;
    }
 document.mapserv.imgxy.value = x + " " + y;
 document.mapserv.submit();  
}        

</script>

<TR>
 <TD width="19" height="23" ALIGN="left" VALIGN="top" BGCOLOR="#e7a500"><a href="javascript:pan('nw')"><img src="../images/cornerarrow5.gif" alt="pan nw" width="25" height="25" style="border-style:none"></a></TD>

 <TD ALIGN="center" BGCOLOR="#e7a500"  VALIGN="top"> <div align="center"><a href="javascript:pan('n')"><img src="../images/cornerarrow2.gif" alt="pan north" width="25" height="25" style="border-style:none"></a></div></TD>
                                          
<TD width="18" ALIGN="right" VALIGN="top" BGCOLOR="#e7a500"><a href="javascript:pan('ne')"><img src="../images/cornerarrow6.gif" alt="pan ne" width="25" height="25" style="border-style:none"></a></TD>
                                        </TR>


 			
---------------------------------
See the all-new, redesigned Yahoo.com.  Check it out.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20060725/cc6156b0/attachment.html


More information about the mapserver-users mailing list