Parsing Error in Zooming
Charu Verma
charu24 at GMAIL.COM
Tue Mar 22 18:07:57 PST 2005
hi all,
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 everything 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>
<table class="header" width="100%" cellspacing="0" cellpadding="0">
<tr><td>
<table width="100%" cellspacing="0" cellpadding="0" border="3"
height="25" bordercolor="99ccff" bordercolorlight="6699ff"
bordercolordark="003366"
background="http://LISTS.UMN.EDU/archives/images/ls2-header.gif"><tr><td
bordercolordark="3399ff" bordercolorlight="0066ff">
<table width="100%" cellspacing="0" border="0"><tr><td width="100%"
nowrap> <a href="http://www.lsoft.com" target="_blank"> <img
src="http://LISTS.UMN.EDU/archives/images/ls2-lsoft.gif" border="0"
alt="L-Soft"></a> <img
src="http://LISTS.UMN.EDU/archives/images/ls2-18e.gif" border="0"
alt="LISTSERV(R) 1.8e">
</td></tr></table> </td></tr></table>
<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>
Here's the map file:
MAP
NAME "NONAME"
SIZE 600 400
IMAGETYPE PNG
IMAGECOLOR 200 200 200
STATUS ON
EXTENT -79.762299 40.477100 -71.777000 45.015751
UNITS METERS
SHAPEPATH "C:/ms4w/apache/htdocs/"
WEB
IMAGEPATH "C:/ms4w/apache/htdocs/"
IMAGEURL"file:///C:/ms4w/apache/htdocs/"
END
LAYER
NAME "NONAME"
TYPE POLYGON
STATUS ON
DATA "NONAME"
CLASS
STYLE
OUTLINECOLOR 255 255 0
COLOR 0 0 128
SYMBOL 0
END
END
END
END
Please help me out
More information about the MapServer-users
mailing list