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

julius muchemi muchemijg at yahoo.com
Mon May 31 04:37:35 EDT 2004


--0-2129600517-1085992655=:28075
Content-Type: text/plain; charset=us-ascii

Yes the array explode has worked as per your instructions
 
Could also somebody sought me out on this next error on the same coding
 
 
Fatal error: [MapServer Error]: msCalculateScale(): Invalid image 
 extent. in C:\Program Files\Apache Group\Apache2\htdocs\Nakmap\nakint.php on line 19


AARON KONING <aaronkoning at shaw.ca> wrote:
The PHP function 'explode' requires two arguments and you have only provided one. Change the explode function on line 18 to include the two arguments as per below.

Function definition from php.net:

array explode ( string separator, string string [, int limit])

Aaron



----- Original Message -----
From: julius muchemi 
Date: Saturday, May 29, 2004 5:57 am
Subject: [Mapserver-users] mscalculate() and explode()

> 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";
> ?>
> 
> 
> 
> 
> 
> 
> " MEHOD="POST">
> 
> > {
> $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


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

<DIV>Yes the array explode has worked as per your instructions</DIV>
<DIV>&nbsp;</DIV>
<DIV>Could&nbsp;also somebody sought me out&nbsp;on this next error on the same coding</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>Fatal error: [MapServer Error]: msCalculateScale(): Invalid image&nbsp;<BR> extent. in C:\Program Files\Apache&nbsp;Group\Apache2\htdocs\Nakmap\nakint.php on line 19<BR><BR><BR><B><I>AARON KONING &lt;aaronkoning at shaw.ca&gt;</I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">The PHP function 'explode' requires two arguments and you have only provided one. Change the explode function on line 18 to include the two arguments as per below.<BR><BR>Function definition from php.net:<BR><BR>array explode ( string separator, string string [, int limit])<BR><BR>Aaron<BR><BR><BR><BR>----- Original Message -----<BR>From: julius muchemi <MUCHEMIJG at YAHOO.COM><BR>Date: Saturday, May 29, 2004 5:57 am<BR>Subject: [Mapserver-users] mscalculate() and explode()<BR><BR>&gt; i have ahead with the project and after displaying the the layer <BR>&gt; now want to add zoom and pan capabilities to the previous code. <BR>&gt; I'm still on windows 2000. <BR>&gt; i have the following error in browser which i dont know how to <BR>&gt; solve <BR>&gt; <BR>&gt; Warning: Wrong parameter count for explode() in C:\Program <BR>&gt; Files\Apache Group\Apache2\htdocs\Nakmap\nakint.php on line
 18<BR>&gt; Fatal error: [MapServer Error]: msCalculateScale(): Invalid image <BR>&gt; extent. in C:\Program Files\Apache <BR>&gt; Group\Apache2\htdocs\Nakmap\nakint.php on line 19<BR>&gt; The code looks like this:<BR>&gt; ?php <BR>&gt; dl("php_mapscript_4.0.1.dll");<BR>&gt; $map_path = "C:/Program Files/Apache Group/Apache2/htdocs/Nakmap/";<BR>&gt; $map = ms_newMapObj($map_path."nakuru.map");<BR>&gt; $val_zsize=3;<BR>&gt; $check_pan="CHECKED";<BR>&gt; ?&gt;<BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; 
<TABLE cellSpacing=0 bgColor=green border=2 cellpanding="1">
<TBODY>
<TR>
<TD><BR>&gt; 
<FORM action="<?=$php_self;?>" MEHOD="POST"><BR>&gt; </TD>
<TD><BR>&gt; <?<br>&gt; {<BR>&gt; $extent_to_set=explode("EXTENT"); <BR>&gt; $map-<BR>&gt; &gt;setextent($extent_to_set[0],$extent_to_set[1],$extent_to_set[2],$extent_to_set[3]);$my_extent=ms_newpointObj();<BR>&gt; $my_point-&gt;setXY("mapa_x", "mapa_y");<BR>&gt; $my_extent = ms_newrectObj();<BR>&gt; $my_extent = $map-&gt;setextent($extent_to_set[0], $extent_to_set[1], <BR>&gt; $extent_to_set[2], $extent_to_set[3]);<BR>&gt; }<BR>&gt; ?&gt;<BR>&gt; <?<br>&gt; $zoom_factor=("zoom")*("zsize");<BR>&gt; if ($zoom_factor==0)<BR>&gt; {<BR>&gt; $zoom_factor=1;<BR>&gt; $check_pan="CHECKED";<BR>&gt; $CHECK_zout="";<BR>&gt; $check_zin="";<BR>&gt; }<BR>&gt; else if ($zoom_factor&lt;0)<BR>&gt; {<BR>&gt; $check_pan="";<BR>&gt; $check_zout="CHECKED";<BR>&gt; $check_zin="";<BR>&gt; }<BR>&gt; else<BR>&gt; {<BR>&gt; $check_pan="";<BR>&gt; $check_zout="";<BR>&gt; $check_zin="CHECKED";<BR>&gt; }<BR>&gt; $Val_zsize=abs($zoom_factor);<BR>&gt; $map-&gt;zoompoint ($zoom_factor, $my_point, $map-&gt;width,
 $map-<BR>&gt; &gt;height, $my_extent);<BR>&gt; $image = $map-&gt;draw();<BR>&gt; $image_url=$image-&gt;saveWebImage();<BR>&gt; $extent_to_html = $map-&gt;EXTENT-&gt;minx." ".$map-&gt;EXTENT-&gt;miny." <BR>&gt; ".$map-&gt;EXTENT-&gt;maxx." ".$map-&gt;EXTENT-&gt;maxy;<BR>&gt; ?&gt;<BR>&gt; Could trace anything wrong with my zoom and pan code. SPecifically <BR>&gt; this code<BR>&gt; $map-<BR>&gt; &gt;setextent($extent_to_set[0],$extent_to_set[1],$extent_to_set[2],$extent_to_set[3]);and <BR>&gt; $extent_to_html = $map-&gt;EXTENT-&gt;minx." ".$map-&gt;EXTENT-&gt;miny." <BR>&gt; ".$map-&gt;EXTENT-&gt;maxx." ".$map-&gt;EXTENT-&gt;maxy;<BR>&gt; as seem to be source of all the above errors<BR>&gt; Muchemi<BR>&gt; <BR>&gt; <BR>&gt; ---------------------------------<BR>&gt; Do you Yahoo!?<BR>&gt; Friends. Fun. Try the all-new Yahoo! Messenger<BR>
<BLOCKQUOTE></BLOCKQUOTE>
<DIV></DIV></TD></FORM></TR></TBODY></BLOCKQUOTE><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-2129600517-1085992655=:28075--



More information about the mapserver-users mailing list