<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
Ok. I figured out my last question. Apparently, I needed to have a zoomscale instead of a zoompoint. What I also discovered is that zoomscale needed to be set right before I said map->draw. If I copied and pasted $map->zoomscale($zoomscale, $centerpoint, $mapwidth, $mapheight, $utmextent); to where I originally had it (right under where I say $map->setSize()), then the zoomscale won't work. But, if I move it to where I said earlier, it works. Where I originally had the line was after I had $zoomscale, $centerpoint, $mapwidth, $mapheight, and $utmextent declared and set to something - so why that is I don't know.<br><br>If someone knows that would be great help. I'm just curious that's all. <br><br>Also, what's the point of map->zoompoint()? From my understanding of the Mapscript API, you could pick a point on the image according to 0, 0 (being the x, y coordinates from the upper left corner), give it the image width and height and the current extent along with an integer representing zoom level and BAM - there you go. But, nothing happened when I kept giving a different value of zoom level (1, -1, 2, -10, etc.). If I comment out the zoompoint too, it doesn't change a thing. I assume I misinterpreted something?<br><br>My 2 files of importance:<br><br>Larrandy.php<br><br><html><br> <head><br> <title>Mapserver "University of Illinois"</title><br> </head><br> <body><br> <p>Give me ma SPECS, FOOL!!@!@</p><hr><br><br> <form action="index3.php" method="get"><br> Width: <input type="text" name="width" /><br> Height: <input type="text" name="height" /><br><br><br><br> Zoompoint: <input type="text" name="zoompoint" /> Ex. - 1, 2, 3, 4, -1, -2, etc.<br><br><br><br> Zoomscale: <input type="text" name="zoomscale" /> Ex. - 4000, 8000, 16,000, etc.<br><br><br><br> Lower Left Corner:<br><br><br> Latitude #1: <input type="text" name="y1" /><br> Longitue #1: <input type="text" name="x1" /><br><br><br><br> Upper Right Corner:<br><br><br> Latitude #2: <input type="text" name="y2" /><br> Longitue #2: <input type="text" name="x2" /><br><br><br><br> Lat/Long need to be decimal degrees.<br><br><br> Example: <br>40.071888 -88.244698 <br>40.094110 -88.217468<br><br><br> <input type="submit" value="Send Request"/><br> </form> <br> </body><br></html><br><br><br><br><br>index3.php<br><br><?php<br>//dl("php_mapscript.so");<br><br>//width, height parameters<br>$mapwidth = $_GET['width'];<br>$mapheight = $_GET['height'];<br><br>//New point object for Zooming<br>$centerpoint = ms_newPointObj();<br>//Taking the center points of the image<br>$centerX = $mapwidth/2;<br>$centerY = $mapheight/2;<br>$centerpoint->setXY($centerX, $centerY);<br>echo "The center X coordinate is: ".$centerpoint->x.", The center Y coordinate is: ".$centerpoint->y."<br>";<br><br>//The zoompoint and zoomscale parameters<br>//$zoompoint = $_GET['zoompoint'];<br>//echo "The Zoom Point is: ".$zoompoint."<br>";<br>$zoomscale = $_GET['zoomscale'];<br>echo "The Zoom Scale is: ".$zoomscale."<br>";<br><br>//Coordinates passed will be in decimal degrees. example: -88.244698 40.071888 -88.217468 40.094110<br>$x1 = $_GET['x1'];<br>$y1 = $_GET['y1'];<br>$x2 = $_GET['x2'];<br>$y2 = $_GET['y2'];<br>echo "Before Conversion to UTM: ".$x1." ".$y1." ".$x2." ".$y2."<br>";<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->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->project($latlongProj, $utmProj);<br>$utmextent = $ddextent;<br>//Set converted lat/long x,y's to new UTM x,y's<br>$x1 = $utmextent->minx;<br>$y1 = $utmextent->miny;<br>$x2 = $utmextent->maxx;<br>$y2 = $utmextent->maxy;<br><br>//$y1=$y1+32; 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<br>";<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->setSize($mapwidth, $mapheight);<br><br>//The name of the map<br>$map->set(name, "GENERIC");<br><br>//The type of image produced (Will need to be changed for later)<br>$map->selectOutputFormat("PNG");<br><br>//The color of the background<br>$map->imagecolor->setRGB(140, 140, 140);<br><br>//Sets the output format type<br>$map->outputformat->setOption(name, "png");<br>$map->outputformat->setOption(driver, "GD/PNG");<br>$map->outputformat->setOption(mimetype, "image/png");<br>$map->outputformat->setOption(imagemode, MS_IMAGEMODE_PC256);<br>$map->outputformat->setOption(extension, "png");<br><br>/*<br>FOR LATER WHEN DISTINGUISHING WHETHER LARRY OR RANDY REQUESTS THIS<br>$map->outputformat->setOption(name, "gif");<br>$map->outputformat->setOption(driver, "GD/GIF");<br>$map->outputformat->setOption(mimetype, "image/gif");<br>$map->outputformat->setOption(imagemode, MS_IMAGEMODE_RGB);<br>$map->outputformat->setOption(extension, "gif");<br>*/<br><br>$map->set(shapepath, "/var/www/mapserver/basic/data/statesp020/");<br>$map->setProjection("+proj=utm +ellps=GRS80 +datum=NAD83 +zone=16 +units=m +north +no_defs");<br>//$map->setExtent(393897.50, 4437029.50, 465644.50, 4438945.50);<br>//sets the EXTENT. -.5 is there due to some subtraction going on with the world file<br>$map->setExtent($x1-.5, $y1-.5, $x2-.5, $y2-.5);<br>$map->set(units, MS_METERS);<br>$map->set(debug, MS_ON);<br><br>//Web Object which specifies the image path and the image url for the image Maperver generates<br>$map->web->set(imagepath, "/var/www/mapserver/basic/images/");<br>$map->web->set(imageurl, "/mapserver/basic/images/");<br><br>//The United States layer<br>///////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br>$us = ms_newLayerObj($map);<br>$us->set(name, "US state polygons");<br>$us->set(type, MS_LAYER_POLYGON);<br>$us->set(status, MS_DEFAULT);<br>$us->set(data, "statesp020");<br>$us->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->color->setRGB(240, 230, 140);<br>$usstyle->set(symbol, 0);<br>///////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br><br>//The United States Boundaries Layer<br>///////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br>$usbounds = ms_newLayerObj($map);<br>$usbounds->set(name, "US state boundaries");<br>$usbounds->set(type, MS_LAYER_LINE);<br>$usbounds->set(status, MS_DEFAULT);<br>$usbounds->set(data, "statesp020");<br>$usbounds->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->color->setRGB(50, 50, 50);<br>$usboundsstyle->set(size, 3);<br>$usboundsstyle->set(symbol, 0);<br>///////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br><br>//University Map Layer<br>///////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br>$university = ms_newLayerObj($map);<br>$university->set(name, "University of Illinois");<br>$university->set(type, MS_LAYER_RASTER);<br>$university->set(status, MS_DEFAULT);<br>$university->set(data, "colorUofIllinois.gif");<br>$university->setProjection("+proj=utm +ellps=GRS80 +datum=NAD83 +zone=16 +units=m +north +no_defs");<br>///////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br><br>//$map->zoompoint($zoompoint, $centerpoint, $mapwidth, $mapheight, $utmextent);<br>$map->zoomscale($zoomscale, $centerpoint, $mapwidth, $mapheight, $utmextent);<br>//Draws the image<br>$image=$map->draw();<br>//Produces a url to reference the image by<br>$image_url=$image->saveWebImage();<br>echo $image_url."<br>";<br>?><br><html><br> <head><br> <title>Mapserver "University of Illinois"</title><br> </head><br> <body><br> <img src="<?php echo $image_url?>"><br> <p>University of Illinois</p><br> <a href="Larrandy.php">Go Back</a><br> </body><br></html><br><br> - Chris<br><br /><hr />More photos; more messages; more whatever – Get MORE with Windows Live™ Hotmail®. NOW with 5GB storage. <a href='http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_5G_0907' target='_new'>Get more!</a></body>
</html>