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

AARON KONING aaronkoning at shaw.ca
Sun May 30 03:48:25 EDT 2004


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 <muchemijg at yahoo.com>
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";
> ?>
> <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




More information about the mapserver-users mailing list