[Mapserver-users] how to get extents after using zoomscale()

Stephen Clark stephen.clark at focus.ca
Fri Dec 12 16:09:50 EST 2003


hi all,

I am using php mapscript version 4.0 and wish to retrieve the extents of the
window after I set the scale.

Here is an example :

 $map->set('width',700);
 $map->set('height',700);

 $my_PointObj =  ms_newPointObj();
 $my_PointObj->setXY(350.0,350.0);

 $my_RectObj =  ms_newRectObj();
 $my_RectObj->setextent($extentarray[0], $extentarray[1], $extentarray[2],
$extentarray[3]);

 $map->zoomscale($my_scale, $my_PointObj, 700, 700, $my_RectObj);

 // get the extent after the zoom operation

 $my_RectObj_after_zoom =  ms_newRectObj();
 $my_RectObj_after_zoom = $map->extent;

 // print out the map extent now
 print " the map extent after zoom is [0] : $my_RectObj_after_zoom[0]
<br>";
 print " the map extent after zoom is [1] : $my_RectObj_after_zoom[1] <br>";
 print " the map extent after zoom is [2] : $my_RectObj_after_zoom[2] <br>";
 print " the map extent after zoom is [3] : $my_RectObj_after_zoom[3] <br>";


Why do I get nothing printed out?

thanks
Stephen




More information about the mapserver-users mailing list