[ms4w-users] Parsing Error in Zooming Script

Jeff McKenna jmckenna at dmsolutions.ca
Mon Mar 21 09:29:49 EST 2005


Charu, this list is really for MS4W configuration questions.  Now that 
you have MS4W working you should be using the main MapServer email list 
(subscribe here http://lists.umn.edu/archives/mapserver-users.html).  I 
would recommend including the exact error in your message as well.

sorry.


jeff




Charu Verma wrote:
> My mapfile is noname.map
> I tried running the following script but it always gives me this
> parsing error on line 9.i have checked evverything but am still not
> able to figure out where the problem lies.Please help me.
> Here's my code for zooming and panning: 
> <?php
> 		
> 		 dl('php_mapscript_42.dll');
> 		
> 			
> 		 $val_zsize=3;
> 		 $check_pan="CHECKED";
> 		 $map_path="C:\ms4w\Apache\htdocs\" ;
> 		 $map_file="NONAME.map";
> 		
> 		 $map=ms_newMapObj($map_path.$map_file) ;
> 		
> 		
> 		 if ( isset($HTTP_POST_VARS["noname_x"]) && isset($HTTP_POST_VARS["noname_y"])
> 		      && !isset($HTTP_POST_VARS["full"]) ) {
> 		
> 		      $extent_to_set = explode(" ",$HTTP_POST_VARS["extent"]); 
> 		
> 		      $map->setextent($extent_to_set[0],$extent_to_set[1],
> 		                      $extent_to_set[2],$extent_to_set[3]);
> 		
> 		      $my_point = ms_newpointObj();
> 		      $my_point->setXY($HTTP_POST_VARS["noname_x"],$HTTP_POST_VARS["noname_y"]);
> 		
> 		      $my_extent = ms_newrectObj();
> 		
> 		     $my_extent->setextent($extent_to_set[0],$extent_to_set[1],
> 		                              $extent_to_set[2],$extent_to_set[3]);
> 		
> 		      $zoom_factor = $HTTP_POST_VARS["zoom"]*$HTTP_POST_VARS["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;
> 		
> 		 ?>
> 		 <HTML>
> 		 <HEAD>
> 		 <TITLE>Map 2</TITLE>
> 		 </HEAD>
> 		 <BODY>
> 		 <CENTER>
> 		 <FORM METHOD=POST ACTION=<?php echo $HTTP_SERVER_VARS['PHP_SELF']?>>
> 		 <TABLE>
> 		 <TR>
> 		      <TD>
> 		             <INPUT TYPE=IMAGE NAME="noname" SRC="<?php echo $image_url?>">
> 		      </TD>
> 		 </TR>
> 		 <TR>
> 		     <TD>
> 		             Pan
> 		      </TD>
> 		      <TD>
> 		              <INPUT TYPE=RADIO NAME="zoom" VALUE=0 <?php echo $check_pan?>>
> 		      </TD>
> 		 </TR>
> 		 <TR>
> 		      <TD>
> 		             Zoom In
> 		      </TD>
> 		      <TD>
> 		             <INPUT TYPE=RADIO NAME="zoom" VALUE=1 <?php echo $check_zin?>>
> 		     </TD>
> 		 </TR>
> 		 <TR>
> 		      <TD>
> 		             Zoom Out
> 		     </TD>
> 		      <TD>
> 		             <INPUT TYPE=RADIO NAME="zoom" VALUE=-1 <?php echo $check_zout?>>
> 		      </TD>
> 		 </TR>
> 		 <TR>
> 		      <TD>
> 		              Zoom Size
> 		      </TD>
> 		     <TD>
> 		              <INPUT TYPE=TEXT NAME="zsize" VALUE="<?php echo $val_zsize?>" 
> 		              SIZE=2>
> 		      </TD>
> 		 </TR>
> 		 <TR>
> 		      <TD>
> 		              Full Extent
> 		     </TD>
> 		      <TD>
> 		             <INPUT TYPE=SUBMIT NAME="full" VALUE="Go" 
> 		             SIZE=2>
> 		    </TD>
> 		 </TABLE>
> 		 <INPUT TYPE=HIDDEN NAME="extent" VALUE="<?php echo $extent_to_html?>">
> 		 </FORM>
> 		 </CENTER>
> 		 </BODY>
> 		 </HMTL>
> _

-- 
Jeff McKenna
DM Solutions Group Inc.
http://www.dmsolutions.ca



More information about the ms4w-users mailing list