Zoom to Real Point

Mike Davis mike.and.kerry at GMAIL.COM
Mon Oct 18 22:19:16 EDT 2004


I am not sure I follow your code exactly but I think you are
multiplying by two when you should be dividing eg:

$right_brdr = ($link[0] + ($_COOKIE["CTRENCH_GIS_CONF-WIDTH"] /2));
$left_brdr = ($link[0] - ($_COOKIE["CTRENCH_GIS_CONF-WIDTH"] /2));
$top_brdr = ($link[1] + ($_COOKIE["CTRENCH_GIS_CONF-HEIGHT"] /2));
$bottom_brdr = ($link[1] - ($_COOKIE["CTRENCH_GIS_CONF-HEIGHT"] /2));

If I follow your intent correctly you want to set the border extents
equal to "CTRENCH_GIS_HEIGHT" x "CTRENCH_GIS_WIDTH" so you want to add
half the height to the top, subtract half the height from the bottom,
add half the width to the right and subtract half the width from the
left.  By multiplying by two instead of dividing you are positioning
your desired point 1/4 of the way across the screen.

But it is the end of a long day and I might be code drunk

-Mike



More information about the mapserver-users mailing list