<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
Hello,<br><br>I have an HTML form (for now for testing purposes) called Larrandy.php that passes some user-defined parameters to another .php file called index3.php.&nbsp; Everything works as planned except the zoom level.&nbsp; What I'm attempting to do is: where it says Zoompoint on the form, I'll enter in the level it should be zoomed in or out (e.g. 1, 2, 3, -1, etc.), and then it should either zoom in or out according to the integer entered in the form.<br><br>I've looked at the API of course.&nbsp; Under the mapObj Class I see zoompoint, zoomrectangle, and zoomscale.&nbsp; I've selected zoompoint, being as I just simply want to take the center point of the generated image and zoom in or out while focused on that point.&nbsp; The pointObj is defined toward the top of index3.php.&nbsp; I have a current rectObj extent set also.&nbsp; I will be receiving an extent in Latitude and Longitude projection.&nbsp; That projection will have to get converted to a UTM projection.&nbsp; Otherwise, the image that I want to display on the US map won't show.&nbsp;&nbsp; I achieved this via a world file which uses UTM projection.&nbsp; Keep in mind that before I attempted to add the zooming capability, everything worked and still does (except the zoom of course).<br><br>I enter in different values on the form, but the generated pic never changes.&nbsp; What exactly am I doing wrong here?<br><br>My .php file with the form - Larrandy.php<br>&lt;html&gt;<br>&nbsp;&nbsp;&nbsp; &lt;head&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;title&gt;Mapserver "University of Illinois"&lt;/title&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/head&gt;<br>&nbsp;&nbsp;&nbsp; &lt;body&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;p&gt;Give me ma SPECS, FOOL!!@!@&lt;/p&gt;&lt;hr&gt;&lt;br&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;form action="index3.php" method="get"&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Width: &lt;input type="text" name="width" /&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Height: &lt;input type="text" name="height" /&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Zoompoint: &lt;input type="text" name="zoompoint" /&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Lower Left Corner:&lt;br&gt;&lt;br&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Latitude #1: &lt;input type="text" name="y1" /&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Longitue #1: &lt;input type="text" name="x1" /&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Upper Right Corner:&lt;br&gt;&lt;br&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Latitude #2: &lt;input type="text" name="y2" /&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Longitue #2: &lt;input type="text" name="x2" /&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Lat/Long need to be decimal degrees.&lt;br&gt;&lt;br&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Example: &lt;br&gt;40.071888 -88.244698 &lt;br&gt;40.094110 -88.217468&lt;br&gt;&lt;br&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;input type="submit" value="Send Request"/&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/form&gt;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &lt;/body&gt;<br>&lt;/html&gt;<br><br><br><br>My .php file that executes all the map rendering - index3.php<br>&lt;?php<br>//dl("php_mapscript.so");<br><br>//width, height parameters<br>//$mapwidth = 750;&nbsp;&nbsp;&nbsp; //These are hard-coded "parameters"<br>//$mapheight = 500;<br>$mapwidth = $_GET['width'];<br>$mapheight = $_GET['height'];<br><br>$centerpoint = ms_newPointObj();<br>$centerX = $mapwidth/2;<br>$centerY = $mapheight/2;<br>$centerpoint-&gt;setXY($centerX, $centerY);<br>echo $centerpoint-&gt;x.", ".$centerpoint-&gt;y."&lt;br&gt;";<br><br>$zoompoint = $_GET['zoompoint'];<br>echo $zoompoint."&lt;br&gt;";<br><br>$x1 = $_GET['x1'];<br>$y1 = $_GET['y1'];<br>$x2 = $_GET['x2'];<br>$y2 = $_GET['y2'];<br>//parameters will be decimal degrees.&nbsp; example: -88.244698 40.071888 -88.217468 40.094110<br>//$x1 = -88.244698;&nbsp;&nbsp;&nbsp; //These are the hard-coded "parameters"<br>//$y1 = 40.071888;<br>//$x2 = -87.527468;<br>//$y2 = 40.094110;<br>echo "Before Conversion to UTM: ".$x1." ".$y1." ".$x2." ".$y2."&lt;br&gt;";<br><br>//The lat/long conversion to UTM process<br>///////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br>//Create a new Rect Obj to be the new, converted EXTENT<br>$ddextent = ms_newRectObj();<br>//Set the extent with the "parameters"<br>$ddextent-&gt;setextent($x1, $y1, $x2, $y2);<br>//Create 2 new Proj Objects to be used for the conversion (latitude/longitude and Universal Transverse Mercator)<br>$latlongProj = ms_newProjectionObj("+proj=latlong +ellps=GRS80 +datum=NAD83");<br>$utmProj = ms_newProjectionObj("+proj=utm +ellps=GRS80 +datum=NAD83 +zone=16 +units=m +north +no_defs");<br>//Convert the lat/long to UTM<br>$ddextent-&gt;project($latlongProj, $utmProj);<br>//Set converted lat/long x,y's to new UTM x,y's<br>$x1 = $ddextent-&gt;minx;<br>$y1 = $ddextent-&gt;miny;<br>$x2 = $ddextent-&gt;maxx;<br>$y2 = $ddextent-&gt;maxy;<br><br>//$y1=$y1+32;&nbsp; THESE +-32's are to possibly compensate for something odd going on with the y's.<br>//$y2=$y2-32;<br>echo "After Conversion to UTM: minX=$x1, minY=$y1, maxX=$x2, maxY=$y2&lt;br&gt;";<br>///////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br><br>//The mapfile path and map file itself<br>$map_path = "/var/www/mapserver/basic/";<br>$map_file = "index3.map";<br>$map = ms_newMapObj($map_path.$map_file);<br><br>//The size of the window set by mapserver<br>$map-&gt;setSize($mapwidth, $mapheight);<br><br>$map-&gt;zoompoint($zoompoint, $centerpoint, $mapwidth, $mapheight, $ddextent);<br><br>//The name of the map<br>$map-&gt;set(name, "GENERIC");<br><br>//The type of image produced (Will need to be changed for later)<br>$map-&gt;selectOutputFormat("PNG");<br><br>//The color of the background<br>$map-&gt;imagecolor-&gt;setRGB(140, 140, 140);<br><br>//Sets the output format type<br>$map-&gt;outputformat-&gt;setOption(name, "png");<br>$map-&gt;outputformat-&gt;setOption(driver, "GD/PNG");<br>$map-&gt;outputformat-&gt;setOption(mimetype, "image/png");<br>$map-&gt;outputformat-&gt;setOption(imagemode, MS_IMAGEMODE_PC256);<br>$map-&gt;outputformat-&gt;setOption(extension, "png");<br><br>/*<br>FOR LATER WHEN DISTINGUISHING WHETHER LARRY OR RANDY REQUESTS THIS<br>$map-&gt;outputformat-&gt;setOption(name, "gif");<br>$map-&gt;outputformat-&gt;setOption(driver, "GD/GIF");<br>$map-&gt;outputformat-&gt;setOption(mimetype, "image/gif");<br>$map-&gt;outputformat-&gt;setOption(imagemode, MS_IMAGEMODE_RGB);<br>$map-&gt;outputformat-&gt;setOption(extension, "gif");<br>*/<br><br>$map-&gt;set(shapepath, "/var/www/mapserver/basic/data/statesp020/");<br>$map-&gt;setProjection("+proj=utm +ellps=GRS80 +datum=NAD83 +zone=16 +units=m +north +no_defs");<br>//$map-&gt;setExtent(393897.50, 4437029.50, 465644.50, 4438945.50);<br>//sets the EXTENT.&nbsp; -.5 is there due to some subtraction going on with the world file<br>$map-&gt;setExtent($x1-.5, $y1-.5, $x2-.5, $y2-.5);<br>$map-&gt;set(units, MS_METERS);<br>$map-&gt;set(debug, MS_ON);<br><br>//Web Object which specifies the image path and the image url for the image Maperver generates<br>$map-&gt;web-&gt;set(imagepath, "/var/www/mapserver/basic/images/");<br>$map-&gt;web-&gt;set(imageurl, "/mapserver/basic/images/");<br><br>//The United States layer<br>///////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br>$us = ms_newLayerObj($map);<br>$us-&gt;set(name, "US state polygons");<br>$us-&gt;set(type, MS_LAYER_POLYGON);<br>$us-&gt;set(status, MS_DEFAULT);<br>$us-&gt;set(data, "statesp020");<br>$us-&gt;setProjection("+proj=latlong +ellps=GRS80 +datum=NAD83");<br>//The United States layer class<br>$usclass = ms_newClassObj($us);<br>//The United States layer class style<br>$usstyle = ms_newStyleObj($usclass);<br>$usstyle-&gt;color-&gt;setRGB(240, 230, 140);<br>$usstyle-&gt;set(symbol, 0);<br>///////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br><br>//The United States Boundaries Layer<br>///////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br>$usbounds = ms_newLayerObj($map);<br>$usbounds-&gt;set(name, "US state boundaries");<br>$usbounds-&gt;set(type, MS_LAYER_LINE);<br>$usbounds-&gt;set(status, MS_DEFAULT);<br>$usbounds-&gt;set(data, "statesp020");<br>$usbounds-&gt;setProjection("+proj=latlong +ellps=GRS80 +datum=NAD83");<br>//The US Boundaries layer class<br>$usboundsclass = ms_newClassObj($usbounds);<br>//The US Boundaries layer class style<br>$usboundsstyle = ms_newStyleObj($usboundsclass);<br>$usboundsstyle-&gt;color-&gt;setRGB(50, 50, 50);<br>$usboundsstyle-&gt;set(size, 3);<br>$usboundsstyle-&gt;set(symbol, 0);<br>///////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br><br>//University Map Layer<br>///////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br>$university = ms_newLayerObj($map);<br>$university-&gt;set(name, "University of Illinois");<br>$university-&gt;set(type, MS_LAYER_RASTER);<br>$university-&gt;set(status, MS_DEFAULT);<br>$university-&gt;set(data, "colorUofIllinois.gif");<br>$university-&gt;setProjection("+proj=utm +ellps=GRS80 +datum=NAD83 +zone=16 +units=m +north +no_defs");<br>///////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br><br>//Draws the image<br>$image=$map-&gt;draw();<br>//Produces a url to reference the image by<br>$image_url=$image-&gt;saveWebImage();<br>echo $image_url;<br>?&gt;<br>&lt;html&gt;<br>&nbsp;&nbsp;&nbsp; &lt;head&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;title&gt;Mapserver "University of Illinois"&lt;/title&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/head&gt;<br>&nbsp;&nbsp;&nbsp; &lt;body&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;img src="&lt;?php echo $image_url?&gt;"&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;p&gt;University of Illinois&lt;/p&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;a href="Larrandy.php"&gt;Go Back&lt;/a&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/body&gt;<br>&lt;/html&gt;<br><br>My map file - index3.map<br>MAP <br>&nbsp;&nbsp;&nbsp; <br>END<br><br><br><br>I wanted the .php file to handle all the mapping commands for learning purposes, that's why it's empty.<br><br>Thanks in advance!<br><br>&nbsp;- Chris<br><br><br /><hr />Kick back and relax with hot games and cool activities at the Messenger Café. <a href='http://www.cafemessenger.com?ocid=TXT_TAGLM_SeptWLtagline' target='_new'>Play now!</a></body>
</html>