Greetings,
I'm trying to write a mapping app that the user can click on some nav
buttons (Up, Down, Lf, Rt, Zooom, etc) to pan/zoom the image but also
include 'ismap' such that where ever the user clicks on the image, it
will recenter on that spot (X,Y). I can get things working with either
the nav buttons or ismap but not both due to fact that I need to pass 3
additional name/value pairs (xc,yc,z_num) to the calling script. This
is what I'm trying:
<?php
//########### geo_caller.php #############//
//#### Original Image size 1800 X 1200 ######//
$base = 0.8;
$input=array_ke ys($_GET);
if (isset($zoom)) {
$z_num += $zoom;
$z_fact = pow($base,$z_nu m);
} elseif (isset($horz)) {
$z_fact = pow($base,$z_nu m);
$xc += $horz*80*$z_fac t;
} elseif (isset($vert)) {
$z_fact = pow($base,$z_nu m);
$yc += $vert*60*$z_fac t;
} elseif (isset($input[0])) {
$z_fact = pow($base,$z_nu m);
$coords = explode(',', $input[0]);
$xc += (400-$coords[0])*$z_fact;
$yc += (300-$coords[1])*$z_fact;
} else {
$z_num = 0;
$z_fact = 1;
$xc = 900;
$yc = 600;
}
$scr_wdth = $z_fact*800;
$scr_ht = $z_fact*600;
$scr_x = $xc-($scr_wdth/2);
$scr_y = $yc-($scr_ht/2);
print "<input type=hidden name=xc value=$xc>";
print "<input type=hidden name=yc value=$yc>";
print "<input type=hidden name=z_num value=$z_num>";
echo "<a href=\"geo_call er.php\">";
echo "<img
src=\"geo_plot. php?SCR_WDTH=$s cr_wdth&SCR_HT= $scr_ht&SCR_X=$ scr_x&SCR_Y=$sc r_y\"
border=0 width=800 height=600 ismap></a>;\n";
?>
I need to somehow pass/retain the current xc, yc, z_num variables but I
can't when using 'ismap'. I've found snippets of javascript where I can
extract the X,Y coordinates but it gets to complicated trying to mix
the two.
Any ideas?
-Matt
I'm trying to write a mapping app that the user can click on some nav
buttons (Up, Down, Lf, Rt, Zooom, etc) to pan/zoom the image but also
include 'ismap' such that where ever the user clicks on the image, it
will recenter on that spot (X,Y). I can get things working with either
the nav buttons or ismap but not both due to fact that I need to pass 3
additional name/value pairs (xc,yc,z_num) to the calling script. This
is what I'm trying:
<?php
//########### geo_caller.php #############//
//#### Original Image size 1800 X 1200 ######//
$base = 0.8;
$input=array_ke ys($_GET);
if (isset($zoom)) {
$z_num += $zoom;
$z_fact = pow($base,$z_nu m);
} elseif (isset($horz)) {
$z_fact = pow($base,$z_nu m);
$xc += $horz*80*$z_fac t;
} elseif (isset($vert)) {
$z_fact = pow($base,$z_nu m);
$yc += $vert*60*$z_fac t;
} elseif (isset($input[0])) {
$z_fact = pow($base,$z_nu m);
$coords = explode(',', $input[0]);
$xc += (400-$coords[0])*$z_fact;
$yc += (300-$coords[1])*$z_fact;
} else {
$z_num = 0;
$z_fact = 1;
$xc = 900;
$yc = 600;
}
$scr_wdth = $z_fact*800;
$scr_ht = $z_fact*600;
$scr_x = $xc-($scr_wdth/2);
$scr_y = $yc-($scr_ht/2);
print "<input type=hidden name=xc value=$xc>";
print "<input type=hidden name=yc value=$yc>";
print "<input type=hidden name=z_num value=$z_num>";
echo "<a href=\"geo_call er.php\">";
echo "<img
src=\"geo_plot. php?SCR_WDTH=$s cr_wdth&SCR_HT= $scr_ht&SCR_X=$ scr_x&SCR_Y=$sc r_y\"
border=0 width=800 height=600 ismap></a>;\n";
?>
I need to somehow pass/retain the current xc, yc, z_num variables but I
can't when using 'ismap'. I've found snippets of javascript where I can
extract the X,Y coordinates but it gets to complicated trying to mix
the two.
Any ideas?
-Matt
Comment