<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Dear all,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I am currently stuck in a rut when trying to make a php mapscript that makes it possible to zoom into a map multiple times. I have it so that when the user clicks on the image it sends to my php script a set of coordinates based on where an <img> is clicked using the ismap attribute. The href is self referencing and reopens the same .php document the tags are in. Now my problem comes in where once I’ve zoomed in once by a factor of 2, the next time the user clicks on the image and zoomtopoint()is called again, it is still referencing the same extent it did for the first call to zoomtopoint(). How do I carry over the values from the extent generated after the first zoom to any zoomtopoint() call from there on out.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Here is my mapscript:<o:p></o:p></p><p class=MsoNormal><?php<o:p></o:p></p><p class=MsoNormal> $map_path="/usr/lib/cgi-bin/";<o:p></o:p></p><p class=MsoNormal> $map = ms_newMapObj($map_path."blah_test.map");<o:p></o:p></p><p class=MsoNormal> if (count($_GET)) {<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal> $map_path="/usr/lib/cgi-bin/";<o:p></o:p></p><p class=MsoNormal> $map = ms_newMapObj($map_path."blah_test.map");<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal> $map_height=$map->height;<o:p></o:p></p><p class=MsoNormal> $map_width=$map->width; <o:p></o:p></p><p class=MsoNormal> $map_extent=$map->extent;<o:p></o:p></p><p class=MsoNormal> $x1=$map_extent->minx;<o:p></o:p></p><p class=MsoNormal> $y1=$map_extent->miny;<o:p></o:p></p><p class=MsoNormal> $x2=$map_extent->maxx;<o:p></o:p></p><p class=MsoNormal> $y2=$map_extent->maxy;<o:p></o:p></p><p class=MsoNormal> $e= array($x1, $y1, $x2, $y2);<o:p></o:p></p><p class=MsoNormal> print_r($e);<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal> $coords = array_keys($_GET);<o:p></o:p></p><p class=MsoNormal> $coords = explode(',', $coords[0]);<o:p></o:p></p><p class=MsoNormal> $x = $coords[0];<o:p></o:p></p><p class=MsoNormal> $y = $coords[1];<o:p></o:p></p><p class=MsoNormal> $zoom_point=new pointObj();<o:p></o:p></p><p class=MsoNormal> $zoom_point->setXY($x,$y);<o:p></o:p></p><p class=MsoNormal> $zoomFactor=2; //set zoomFactor to positive or negative depending on the user's input via button<o:p></o:p></p><p class=MsoNormal> $map_extent=$map->extent;<o:p></o:p></p><p class=MsoNormal> $map->zoompoint($zoomFactor,$zoom_point,$map_width,$map_height,$map_extent);<o:p></o:p></p><p class=MsoNormal> $map_extent=$map->extent;<o:p></o:p></p><p class=MsoNormal> $x1=$map_extent->minx;<o:p></o:p></p><p class=MsoNormal> $y1=$map_extent->miny;<o:p></o:p></p><p class=MsoNormal> $x2=$map_extent->maxx;<o:p></o:p></p><p class=MsoNormal> $y2=$map_extent->maxy;<o:p></o:p></p><p class=MsoNormal> $e= array($x1, $y1, $x2, $y2);<o:p></o:p></p><p class=MsoNormal> print_r($e);<o:p></o:p></p><p class=MsoNormal> }<o:p></o:p></p><p class=MsoNormal> $image=$map->draw();<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal> $image_url=$image->saveWebImage();<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal> ?><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Here is the image tag:<o:p></o:p></p><p class=MsoNormal><div id="map"><o:p></o:p></p><p class=MsoNormal> <a href="blahtest.php" name="img"> // here is the self referencing href<o:p></o:p></p><p class=MsoNormal style='margin-left:1.0in'><img type="image" name="img" id="map" ismap="ismap" type="image" src=<?php echo $image_url; ?> width="<?php echo $map_width; ?>" height="<?php echo $map_height; ?> "border=0 alt="Map Image"><o:p></o:p></p><p class=MsoNormal> </a><o:p></o:p></p><p class=MsoNormal></div><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Any help is appreciated!<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>-Paul<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>