[Mapserver-users] map positioning -- help needed

Murat Isik muratisik at megatek.com.tr
Fri Nov 7 09:03:17 EST 2003


This is a multi-part message in MIME format.

------=_NextPart_000_019B_01C3A548.A8148010
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Thank you.
I think I have minimized my problem to this whole coordinate thing. What =
I noticed is that my code does not catch "extent" as it works. I have to =
feed it with the beginning coordinates myself. I have changed the code a =
little bit too. Now it can move the map to left, but only the original =
map, not the zoom map. I think my problem is that I cannot "catch" the =
coordinates/extents of the last map drawn. It has something to do with =
this line:

$extent_to_set =3D explode(" ",$HTTP_POST_VARS["extent"]);

When I run the second europa example from mapserver site the same line =
works and prints the picture. In my case, it produces this error:

Fatal error: MapServer Error in msCalculateScale():=20

referring to the line with the "explode". The EXTENT in europa is in =
this format:

EXTENT -5696501 1923039 5696501 11022882

whereas mine is:

EXTENT 29.057 40.954 29.143 40.999

My extents work with the mapserver itself. When I check a regular map =
from an atlas, I see they use my type of coordinates. It appears my =
geograph is not so well at all!
I suppose this is related to what Mr.Bridger discussed in his reply mail =
but how related is something I didnt understand. Any ideas?

BTW: I am using php-mapscript-3.6.0-4, installed by rpm. May the version =
be related? Bug or something?

Have a nice day:)

Murat Isik

current php code: (if needed I can also send my mapfile. I am not =
sending now not to take much space in your mailboxes...)

<HEAD>
<TITLE>TEST</TITLE>
</HEAD>
<CENTER>
<FORM METHOD=3DPOST ACTION=3D<?php echo $PHP_SELF?>>
<H1>TEST SERVER</H1>
<P>
<?php
dl("php_mapscript.so");

mysql_connect("localhost","root","test") or
        die ("Could not connect to database");

mysql_select_db("pointtrack") or
        die("Could not select database");

$val_zsize=3D3;
file://$check_pan=3D"CHECKED";

$shpFname =3D "target1";
$shpFile =3D ms_newShapeFileObj($shpFname, MS_SHP_POINT);

$shpFname1 =3D "target2";
$shpFile1 =3D ms_newShapeFileObj($shpFname1, MS_SHP_POINT);

$pt =3D ms_newPointObj();

$i =3D 0;

$result =3D mysql_query("select * from track3") or
        die (mysql_error());


$x[0]=3D0;
$y[0]=3D0;

while ($row =3D mysql_fetch_array($result))
{
++$i;
$test_x[$i] =3D $row["lodegrees"]+$row["lominutes"]/60;
$test_y[$i] =3D $row["ldegrees"]+$row["lminutes"]/60;



if($test_x[$i]=3D=3D$x[$i-1] || $test_y[$i]=3D=3D$y[$i-1])
{
--$i;
}else
{

$x[$i] =3D $test_x[$i];
$y[$i] =3D $test_y[$i];

}

}
mysql_free_result($result);


for($k=3D1;$k<=3D$i-1;++$k)
{
$pt->setXY($x[$k], $y[$k]);
$shpFile->addPoint($pt);
};

$pt->setXY($x[$i], $y[$i]);
$shpFile1->addPoint($pt);


$shpFile->free();
$shpFile1->free();

$def =3Darray(array("UNIQID", "C", 13),array("NOM", "C", 128));
$dbfFile =3D dbase_create($shpFname.".dbf", $def);
dbase_add_record($dbfFile, array("1","TEST"));

$def =3Darray(array("UNIQID", "C", 13),array("NOM", "C", 128));
$dbfFile =3D dbase_create($shpFname1.".dbf", $def);
dbase_add_record($dbfFile, array("1","TEST"));

$myMap =3D ms_newMapObj("demo_try.map");

#$myLayer =3D $myMap->getLayerByName("target1");
#$myLayer->set("data", $shpFname);
#$myLayer->set('status', MS_ON);



if ( isset($HTTP_POST_VARS["mapa_x"]) && =
isset($HTTP_POST_VARS["mapa_y"])
      && !isset($HTTP_POST_VARS["full"]) ) {

//$extent_to_set =3D explode(" ",$HTTP_POST_VARS["extent"]); //source of =
problem I believe


$extent_to_set[0] =3D 29.057;
$extent_to_set[1] =3D 40.954;
$extent_to_set[2] =3D 29.143;
$extent_to_set[3] =3D 40.999; //since upper one doesnot work, I have to =
feed them myself


  $myMap->setextent($extent_to_set[0],
                        $extent_to_set[1],
                             $extent_to_set[2],
                        $extent_to_set[3]);

      $my_point =3D ms_newpointObj();
      =
$my_point->setXY($HTTP_POST_VARS["mapa_x"],$HTTP_POST_VARS["mapa_y"]);

      $my_extent =3D ms_newrectObj();

      $my_extent->setextent($extent_to_set[0],$extent_to_set[1],
                              $extent_to_set[2],$extent_to_set[3]);



$zoom_factor =3D $HTTP_POST_VARS["zoom"]*$HTTP_POST_VARS["zsize"];
      if ($zoom_factor =3D=3D 0) {
              $zoom_factor =3D 1;
              $check_pan =3D "CHECKED";
              $check_zout =3D "";
              $check_zin =3D "";
      } else if ($zoom_factor < 0) {
              $check_pan =3D "";
              $check_zout =3D "CHECKED";
              $check_zin =3D "";
      } else {
              $check_pan =3D "";
              $check_zout =3D "";
              $check_zin =3D "CHECKED";
      }

      $val_zsize =3D abs($zoom_factor);

      =
$myMap->zoompoint($zoom_factor,$my_point,$myMap->width,$myMap->height,
                      $my_extent);

}
if($HTTP_POST_VARS["zoom"] =3D=3D 2)//this part should "catch the extent =
of=20
                                                       //the latest map =
drawn so it can recalculate based on it.
{
//        $xmax =3D $myMap->extent->{xmax};
//        $xmin =3D $myMap->extent->{xmin};
//        $xmin =3D $extent_to_set[0];
//        $xmax =3D $extent_to_set[2];
        $xmin =3D 29.057;
        $xmax =3D 29.143;
        $xinc =3D ($xmax - $xmin ) / 2;
        $ymin =3D 40.954;
        $ymax =3D 40.999;
        $myMap->setextent( ($xmin + $xinc), $ymin, ($xmax + $xinc), =
$ymax);


}

$img =3D $myMap->draw();
$image_url =3D $img->saveWebImage(GIF,1,1,0);

//$extent_to_html =3D $map->extent->minx." ".$map->extent->miny." "
//              .$map->extent->maxx." ".$map->extent->maxy;

?>
<BODY>
<center>
<table border=3D0 cellspacing=3D0 cellpadding=3D4 bgcolor=3D"#FFFFFF">
<tr>
<td valign=3D"top" align=3Dcenter>
  <table cellpadding=3D"0" cellspacing=3D"5" border=3D"5">
    <tr><td colspan=3D"2"><INPUT NAME=3D"mapa" TYPE=3D"image" =
SRC=3D"<?php echo $image_url; ?>" width=3D600 height=3D600 =
border=3D0></td></tr>
    <tr>
 <TR>
      <TD>
              Pan
      </TD>
      <TD>
              <INPUT TYPE=3DRADIO NAME=3D"zoom" VALUE=3D0 <?php echo =
$check_pan?>>
      </TD>
 </TR>
 <TR>
      <TD>
              Zoom In
      </TD>
      <TD>
              <INPUT TYPE=3DRADIO NAME=3D"zoom" VALUE=3D1 <?php echo =
$check_zin?>>
      </TD>
 </TR>
 <TR>
      <TD>
              Zoom Out
      </TD>
      <TD>
              <INPUT TYPE=3DRADIO NAME=3D"zoom" VALUE=3D-1 <?php echo =
$check_zout?>>
      </TD>
 </TR>
 <TR>
      <TD>
              Right
      </TD>
      <TD>
              <INPUT TYPE=3DRADIO NAME=3D"zoom" VALUE=3D2 <?php echo =
$check_zout?>>
      </TD>
 </TR>

 <TR>
      <TD>
              Zoom Size
      </TD>
      <TD>
              <INPUT TYPE=3DTEXT NAME=3D"zsize" VALUE=3D"<?php echo =
$val_zsize?>"
              SIZE=3D2>
      </TD>
 </TR>
 <TR>
      <TD>
              Full Extent
      </TD>
      <TD>
              <INPUT TYPE=3DSUBMIT NAME=3D"full" VALUE=3D"Go"
              SIZE=3D2>
      </TD>
</TABLE>
<INPUT TYPE=3DHIDDEN NAME=3D"extent" VALUE=3D"<?php echo =
$extent_to_html?>">
</FORM>
</CENTER>

</BODY>
</HTML>





------=_NextPart_000_019B_01C3A548.A8148010
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.3700.6699" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Thank you.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I think I have minimized my problem to =
this whole=20
coordinate thing. What I noticed is that my code does not catch "extent" =
as it=20
works. I have to feed it with the beginning coordinates myself. I have =
changed=20
the code a little bit too. Now it can move the map to left, but only the =

original map, not the zoom map. I think my problem is that I cannot =
"catch" the=20
coordinates/extents of the last map drawn. It has something to do with =
this=20
line:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>$extent_to_set =3D explode("=20
",$HTTP_POST_VARS["extent"]);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>When I run the second europa example =
from mapserver=20
site the same line works and prints the picture. In my case, it produces =
this=20
error:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Fatal error: MapServer Error in =
msCalculateScale():=20
</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>referring to the line with the =
"explode". The=20
EXTENT in europa is in this format:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>EXTENT -5696501 1923039 5696501=20
11022882</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>whereas mine is:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>EXTENT 29.057 40.954 29.143 =
40.999</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>My extents work with the mapserver =
itself. When I=20
check a regular map from an atlas, I see they use my type of =
coordinates. It=20
appears my geograph is not so well at all!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I suppose this is related to what =
Mr.Bridger=20
discussed in his reply mail but how related is something I didnt =
understand. Any=20
ideas?</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>BTW: I am using php-mapscript-3.6.0-4, =
installed by=20
rpm. May the version be related? Bug or something?</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Have a nice day:)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Murat Isik</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>current php code: (if needed&nbsp;I can =
also send=20
my mapfile. I am not sending now not to take much space in your=20
mailboxes...)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial=20
size=3D2>&lt;HEAD&gt;<BR>&lt;TITLE&gt;TEST&lt;/TITLE&gt;<BR>&lt;/HEAD&gt;=
<BR>&lt;CENTER&gt;<BR>&lt;FORM=20
METHOD=3DPOST ACTION=3D&lt;?php echo =
$PHP_SELF?&gt;&gt;<BR>&lt;H1&gt;TEST=20
SERVER&lt;/H1&gt;<BR>&lt;P&gt;<BR>&lt;?php<BR>dl("php_mapscript.so");</FO=
NT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D2>mysql_connect("localhost","root","test")=20
or<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; die ("Could not connect =
to=20
database");</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>mysql_select_db("pointtrack")=20
or<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; die("Could not select=20
database");</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>$val_zsize=3D3;<BR></FONT><A=20
href=3D'file://$check_pan=3D"CHECKED"'><FONT face=3DArial=20
size=3D2>file://$check_pan=3D"CHECKED"</FONT></A><FONT face=3DArial=20
size=3D2>;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>$shpFname =3D "target1";<BR>$shpFile =
=3D=20
ms_newShapeFileObj($shpFname, MS_SHP_POINT);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>$shpFname1 =3D "target2";<BR>$shpFile1 =
=3D=20
ms_newShapeFileObj($shpFname1, MS_SHP_POINT);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>$pt =3D ms_newPointObj();</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>$i =3D 0;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>$result =3D mysql_query("select * from =
track3")=20
or<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; die=20
(mysql_error());</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><BR><FONT face=3DArial =
size=3D2>$x[0]=3D0;<BR>$y[0]=3D0;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>while ($row =3D=20
mysql_fetch_array($result))<BR>{<BR>++$i;<BR>$test_x[$i] =3D=20
$row["lodegrees"]+$row["lominutes"]/60;<BR>$test_y[$i] =3D=20
$row["ldegrees"]+$row["lminutes"]/60;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>if($test_x[$i]=3D=3D$x[$i-1] ||=20
$test_y[$i]=3D=3D$y[$i-1])<BR>{<BR>--$i;<BR>}else<BR>{</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>$x[$i] =3D $test_x[$i];<BR>$y[$i] =3D=20
$test_y[$i];</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D2>}<BR>mysql_free_result($result);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><BR><FONT face=3DArial=20
size=3D2>for($k=3D1;$k&lt;=3D$i-1;++$k)<BR>{<BR>$pt-&gt;setXY($x[$k],=20
$y[$k]);<BR>$shpFile-&gt;addPoint($pt);<BR>};</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>$pt-&gt;setXY($x[$i],=20
$y[$i]);<BR>$shpFile1-&gt;addPoint($pt);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><BR><FONT face=3DArial=20
size=3D2>$shpFile-&gt;free();<BR>$shpFile1-&gt;free();</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>$def =3Darray(array("UNIQID", "C", =
13),array("NOM",=20
"C", 128));<BR>$dbfFile =3D dbase_create($shpFname.".dbf",=20
$def);<BR>dbase_add_record($dbfFile, array("1","TEST"));</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>$def =3Darray(array("UNIQID", "C", =
13),array("NOM",=20
"C", 128));<BR>$dbfFile =3D dbase_create($shpFname1.".dbf",=20
$def);<BR>dbase_add_record($dbfFile, array("1","TEST"));</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>$myMap =3D =
ms_newMapObj("demo_try.map");</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>#$myLayer =3D=20
$myMap-&gt;getLayerByName("target1");<BR>#$myLayer-&gt;set("data",=20
$shpFname);<BR>#$myLayer-&gt;set('status', MS_ON);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>if ( isset($HTTP_POST_VARS["mapa_x"]) =
&amp;&amp;=20
isset($HTTP_POST_VARS["mapa_y"])<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&amp;&amp;=20
!isset($HTTP_POST_VARS["full"]) ) {</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><A href=3D"file://$extent_to_set"><STRONG><FONT face=3DArial=20
size=3D2>//$extent_to_set</FONT></STRONG></A><STRONG><FONT face=3DArial =
size=3D2> =3D=20
explode(" ",$HTTP_POST_VARS["extent"]); </FONT></STRONG><A=20
href=3D"file://source"><STRONG><FONT face=3DArial=20
size=3D2>//source</FONT></STRONG></A><STRONG><FONT face=3DArial =
size=3D2> of problem I=20
believe</FONT></STRONG></DIV>
<DIV>&nbsp;</DIV>
<DIV><BR><FONT face=3DArial size=3D2><STRONG>$extent_to_set[0] =3D=20
29.057;<BR>$extent_to_set[1] =3D 40.954;<BR>$extent_to_set[2] =3D=20
29.143;<BR>$extent_to_set[3] =3D 40.999; <A =
href=3D"file://since">//since</A> upper=20
one doesnot work, I have to feed them myself</STRONG></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><BR><FONT face=3DArial size=3D2>&nbsp;=20
$myMap-&gt;setextent($extent_to_set[0],<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
$extent_to_set[1],<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
$extent_to_set[2],<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;=20
$extent_to_set[3]);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
$my_point =3D=20
ms_newpointObj();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
$my_point-&gt;setXY($HTTP_POST_VARS["mapa_x"],$HTTP_POST_VARS["mapa_y"]);=
</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
$my_extent =3D=20
ms_newrectObj();</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
$my_extent-&gt;setextent($extent_to_set[0],$extent_to_set[1],<BR>&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;=20
$extent_to_set[2],$extent_to_set[3]);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>$zoom_factor =3D=20
$HTTP_POST_VARS["zoom"]*$HTTP_POST_VARS["zsize"];<BR>&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;=20
if ($zoom_factor =3D=3D 0)=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;=20
$zoom_factor =3D=20
1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;=20
$check_pan =3D=20
"CHECKED";<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;=20
$check_zout =3D=20
"";<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;=20
$check_zin =3D "";<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else if =
($zoom_factor &lt;=20
0)=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;=20
$check_pan =3D=20
"";<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;=20
$check_zout =3D=20
"CHECKED";<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;=20
$check_zin =3D "";<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;=20
$check_pan =3D=20
"";<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;=20
$check_zout =3D=20
"";<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;=20
$check_zin =3D "CHECKED";<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
$val_zsize =3D=20
abs($zoom_factor);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
$myMap-&gt;zoompoint($zoom_factor,$my_point,$myMap-&gt;width,$myMap-&gt;h=
eight,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
$my_extent);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>}<BR><STRONG>if($HTTP_POST_VARS["zoom"] =
=3D=3D 2)//this=20
part should "catch the extent=20
of&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</STRONG></FONT><A=20
href=3D"file://the"><STRONG><FONT face=3DArial=20
size=3D2>//the</FONT></STRONG></A><STRONG><FONT face=3DArial size=3D2> =
latest map=20
drawn so it can recalculate based on=20
it.<BR>{<BR>//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $xmax =3D=20
$myMap-&gt;extent-&gt;{xmax};<BR>//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;=20
$xmin =3D=20
$myMap-&gt;extent-&gt;{xmin};<BR>//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;=20
$xmin =3D =
$extent_to_set[0];<BR>//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $xmax =

=3D $extent_to_set[2];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
$xmin =3D=20
29.057;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $xmax =3D=20
29.143;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $xinc =3D ($xmax - =
$xmin ) /=20
2;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $ymin =3D=20
40.954;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $ymax =3D=20
40.999;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
$myMap-&gt;setextent(=20
($xmin + $xinc), $ymin, ($xmax + $xinc), $ymax);</FONT></STRONG></DIV>
<DIV>&nbsp;</DIV>
<DIV><BR><FONT face=3DArial size=3D2><STRONG>}</STRONG></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>$img =3D =
$myMap-&gt;draw();<BR>$image_url =3D=20
$img-&gt;saveWebImage(GIF,1,1,0);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>//</FONT><A =
href=3D"file://$extent_to_html"><FONT=20
face=3DArial size=3D2>$extent_to_html</FONT></A><FONT face=3DArial =
size=3D2> =3D=20
$map-&gt;extent-&gt;minx." ".$map-&gt;extent-&gt;miny."=20
"<BR>//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;=20
.$map-&gt;extent-&gt;maxx." ".$map-&gt;extent-&gt;maxy;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial=20
size=3D2>?&gt;<BR>&lt;BODY&gt;<BR>&lt;center&gt;<BR>&lt;table border=3D0 =

cellspacing=3D0 cellpadding=3D4 =
bgcolor=3D"#FFFFFF"&gt;<BR>&lt;tr&gt;<BR>&lt;td=20
valign=3D"top" align=3Dcenter&gt;<BR>&nbsp; &lt;table cellpadding=3D"0"=20
cellspacing=3D"5" border=3D"5"&gt;<BR>&nbsp;&nbsp;&nbsp; =
&lt;tr&gt;&lt;td=20
colspan=3D"2"&gt;&lt;INPUT NAME=3D"mapa" TYPE=3D"image" SRC=3D"&lt;?php =
echo $image_url;=20
?&gt;" width=3D600 height=3D600=20
border=3D0&gt;&lt;/td&gt;&l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;&nbsp;=20
&lt;/TD&gt;<BR>&lt;/TABLE&gt;<BR>&lt;INPUT TYPE=3DHIDDEN NAME=3D"extent" =

VALUE=3D"&lt;?php echo=20
$extent_to_html?&gt;"&gt;<BR>&lt;/FORM&gt;<BR>&lt;/CENTER&gt;</FONT></DIV=
>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D2>&lt;/BODY&gt;<BR>&lt;/HTML&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><BR>&nbsp;</DIV></FONT></BODY></HTML>

------=_NextPart_000_019B_01C3A548.A8148010--




More information about the mapserver-users mailing list