Hello,
I'm using mapbender (www.mapbender.org) for my work with mapserver. In
one day I had a web application with two mapserver frames which are
individually zoomable and pan-able (sorry) and queryable and a lot of
tables and forms for my application data. Mapbender works with php and
javascript.
So, why not looking into mapbender for example or another client which
does zoom and pan already. Even if you don't want to use it in
production, you can learn from it.
Manfred
Albert Anderson schrieb:
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.
<http://us.rd.yahoo.com/evt=40762/*http://www.yahoo.com/preview>