panning and zoomin and out, and ect..................
Luis Treviño
ltrevinoh at GMAIL.COM
Mon Jul 24 18:38:54 PDT 2006
2006/7/21, Albert Anderson <bart_doggers at yahoo.com>:
>
> Hi,
>
> I figure out my images. Does anyone have a _java script for using a
> image for panning. I have images set for the corners of my map. I want to
> use them to pan.
>
You can use something like this, you have to handle your width and height of
your image:
alto = height, ancho = width.
function paneo(direccion,alto,ancho) {
var x,y;
var pansize = 0.75;
if(direccion == 'n') {
x = (ancho-1)/2.0;
y = 0 - (alto * pansize)/2.0;
} else if(direccion == 'nw') {
x = 0 - (ancho * pansize)/2.0;
y = 0 - (ancho * pansize)/2.0;
} else if(direccion == 'ne') {
x = (ancho-1) + (ancho * pansize)/2.0;
y = 0 - (alto * pansize)/2.0;
} else if(direccion == 's') {
x = (ancho-1)/2.0;
y = (alto-1) + (alto * pansize)/2.0;
} else if(direccion == 'sw') {
x = 0 - (ancho * pansize)/2.0;
y = (alto-1) + (alto * pansize)/2.0;
} else if(direccion == 'se') {
x = (ancho-1) + (ancho * pansize)/2.0;
y = (alto-1) + (alto * pansize)/2.0;
} else if(direccion == 'e') {
x = (ancho-1) + (ancho * pansize)/2.0;
y = (alto-1)/2.0;
} else if(direccion == 'w') {
x = 0 - (ancho * pansize)/2.0;
y = (alto-1)/2.0;
}
document.mapserv.imgxy.value = x + " " + y;
document.mapserv.submit();
}
Anyother question, is there a _java script for images to zoom-in and out?
>
you can use the zoomdir and the zoom values within your template, like:
<input type="hidden" name="zoom" value="-2">
<input type="hidden" name="zoomdir" value="-1">
for a zoom out., so you can use radio buttons to manage this values
> One more question, I have a refresh button and pan radio button, then we I
> click refresh to take a layer off it moves the projective image. Why? But
> when I am on zoomin radio button and click refresh it acts like its panning?
> Why?
>
> Thanks,
>
> Albert
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
Hope this helps.
Regards,
Luis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20060724/dabd6479/attachment.htm>
More information about the MapServer-users
mailing list