[Mapserver-users] mscalculate() and explode()

julius muchemi muchemijg at yahoo.com
Sat May 29 08:57:55 EDT 2004


--0-2045783271-1085835475=:67558
Content-Type: text/plain; charset=us-ascii

i have ahead with the project and after displaying the the layer now want to add zoom and pan capabilities to the previous code. I'm still on windows 2000. 
i have the following error in browser which i dont know how to solve 

Warning: Wrong parameter count for explode() in C:\Program Files\Apache Group\Apache2\htdocs\Nakmap\nakint.php on line 18
Fatal error: [MapServer Error]: msCalculateScale(): Invalid image extent. in C:\Program Files\Apache Group\Apache2\htdocs\Nakmap\nakint.php on line 19
The code looks like this:
?php 
dl("php_mapscript_4.0.1.dll");
 $map_path = "C:/Program Files/Apache Group/Apache2/htdocs/Nakmap/";
 $map = ms_newMapObj($map_path."nakuru.map");
 $val_zsize=3;
 $check_pan="CHECKED";
?>
<HTML>
 <HEAD>
  <TITLE>NAKURU MUNICIPALITY MAP: :By ERMIS AFRICA</TITLE>
 </HEAD>
 <BODY bgcolor="yellow">
<TABLE bgcolor=green cellspacing=0 cellpanding=1 border=2><TR><TD> 
<FORM MEHOD=POST ACTION="<?=$php_self;?>">
</TD><TD>
<?
{
$extent_to_set=explode("EXTENT"); 
$map->setextent($extent_to_set[0],$extent_to_set[1],$extent_to_set[2],$extent_to_set[3]);
$my_extent=ms_newpointObj();
$my_point->setXY("mapa_x", "mapa_y");
$my_extent = ms_newrectObj();
$my_extent = $map->setextent($extent_to_set[0], $extent_to_set[1], $extent_to_set[2], $extent_to_set[3]);
}
?>
<?
$zoom_factor=("zoom")*("zsize");
if ($zoom_factor==0)
{
$zoom_factor=1;
$check_pan="CHECKED";
$CHECK_zout="";
$check_zin="";
}
else if ($zoom_factor<0)
{
$check_pan="";
$check_zout="CHECKED";
$check_zin="";
}
else
{
$check_pan="";
$check_zout="";
$check_zin="CHECKED";
}
$Val_zsize=abs($zoom_factor);
$map->zoompoint ($zoom_factor, $my_point, $map->width, $map->height, $my_extent);
$image = $map->draw();
$image_url=$image->saveWebImage();
$extent_to_html = $map->EXTENT->minx." ".$map->EXTENT->miny." ".$map->EXTENT->maxx." ".$map->EXTENT->maxy;
?>
Could trace anything wrong with my zoom and pan code. SPecifically this code
$map->setextent($extent_to_set[0],$extent_to_set[1],$extent_to_set[2],$extent_to_set[3]);
and  
$extent_to_html = $map->EXTENT->minx." ".$map->EXTENT->miny." ".$map->EXTENT->maxx." ".$map->EXTENT->maxy;
as seem to be source of all the above errors
Muchemi

		
---------------------------------
Do you Yahoo!?
Friends.  Fun. Try the all-new Yahoo! Messenger
--0-2045783271-1085835475=:67558
Content-Type: text/html; charset=us-ascii

<DIV>i have ahead with the project and after displaying the the layer now want to add zoom and pan capabilities to the previous code. I'm still on windows 2000. </DIV>
<DIV>i have the following error in browser which i dont know how to solve </DIV>
<DIV><BR>Warning: Wrong parameter count for explode() in C:\Program Files\Apache Group\Apache2\htdocs\Nakmap\nakint.php on line 18</DIV>
<DIV>Fatal error: [MapServer Error]: msCalculateScale(): Invalid image extent. in C:\Program Files\Apache Group\Apache2\htdocs\Nakmap\nakint.php on line 19</DIV>
<DIV>The code looks like this:</DIV>
<DIV>?php <BR>dl("php_mapscript_4.0.1.dll");<BR>&nbsp;$map_path = "C:/Program Files/Apache Group/Apache2/htdocs/Nakmap/";<BR>&nbsp;$map = ms_newMapObj($map_path."nakuru.map");<BR>&nbsp;$val_zsize=3;<BR>&nbsp;$check_pan="CHECKED";<BR>?&gt;<BR>&lt;HTML&gt;<BR>&nbsp;&lt;HEAD&gt;<BR>&nbsp;&nbsp;&lt;TITLE&gt;NAKURU MUNICIPALITY MAP: :By ERMIS AFRICA&lt;/TITLE&gt;<BR>&nbsp;&lt;/HEAD&gt;<BR>&nbsp;&lt;BODY bgcolor="yellow"&gt;<BR>&lt;TABLE bgcolor=green cellspacing=0 cellpanding=1 border=2&gt;&lt;TR&gt;&lt;TD&gt; <BR>&lt;FORM MEHOD=POST ACTION="&lt;?=$php_self;?&gt;"&gt;<BR>&lt;/TD&gt;&lt;TD&gt;<BR>&lt;?<BR>{<BR>$extent_to_set=explode("EXTENT"); <BR>$map-&gt;setextent($extent_to_set[0],$extent_to_set[1],$extent_to_set[2],$extent_to_set[3]);<BR>$my_extent=ms_newpointObj();<BR>$my_point-&gt;setXY("mapa_x", "mapa_y");<BR>$my_extent = ms_newrectObj();<BR>$my_extent = $map-&gt;setextent($extent_to_set[0], $extent_to_set[1], $extent_to_set[2],
 $extent_to_set[3]);<BR>}<BR>?&gt;<BR>&lt;?<BR>$zoom_factor=("zoom")*("zsize");<BR>if ($zoom_factor==0)<BR>{<BR>$zoom_factor=1;<BR>$check_pan="CHECKED";<BR>$CHECK_zout="";<BR>$check_zin="";<BR>}<BR>else if ($zoom_factor&lt;0)<BR>{<BR>$check_pan="";<BR>$check_zout="CHECKED";<BR>$check_zin="";<BR>}<BR>else<BR>{<BR>$check_pan="";<BR>$check_zout="";<BR>$check_zin="CHECKED";<BR>}<BR>$Val_zsize=abs($zoom_factor);<BR>$map-&gt;zoompoint ($zoom_factor, $my_point, $map-&gt;width, $map-&gt;height, $my_extent);<BR>$image = $map-&gt;draw();<BR>$image_url=$image-&gt;saveWebImage();<BR>$extent_to_html = $map-&gt;EXTENT-&gt;minx." ".$map-&gt;EXTENT-&gt;miny." ".$map-&gt;EXTENT-&gt;maxx." ".$map-&gt;EXTENT-&gt;maxy;<BR>?&gt;</DIV>
<DIV>Could trace anything wrong with my zoom and pan code. SPecifically this code<BR>$map-&gt;setextent($extent_to_set[0],$extent_to_set[1],$extent_to_set[2],$extent_to_set[3]);</DIV>
<DIV>and&nbsp; </DIV>
<DIV>$extent_to_html = $map-&gt;EXTENT-&gt;minx." ".$map-&gt;EXTENT-&gt;miny." ".$map-&gt;EXTENT-&gt;maxx." ".$map-&gt;EXTENT-&gt;maxy;</DIV>
<DIV>as seem to be source of all the above errors<BR>Muchemi</DIV><p>
		<hr size=1><font face=arial size=-1>Do you Yahoo!?<br>Friends.  Fun. <a href="http://messenger.yahoo.com/">Try the all-new Yahoo! Messenger</a>
--0-2045783271-1085835475=:67558--



More information about the mapserver-users mailing list