Problem setting maximum extents

morgan harvey mharvey at PDX.EDU
Mon Jan 9 15:59:12 PST 2006


Hello.

I am using the zoompoint, zoomscale, and zoomrectangle methods within  
PHP MapScript and am observing some incorrect behavior w/r/t the  
maximum extent argument. When zooming out of the map, the maximum  
extents seem only to be bound to a single axis, so that, for  
instance, the minx and maxx boundaries are met, but the map goes way  
over the y extents. It will consistently zoom out until the it passes  
both axis constraints. All other zooming operations work properly for  
me. Is this a bug within mapserver or mapscript (i couldn't find any  
known bug within bugzilla) or is this the way this is supposed to work?

Here's the applicable code:

         if ($extent['x1'] && $extent['y1'] &&
             $extent['x2'] && $extent['y2']) {
                 $map->setExtent($extent['x1'], $extent['y1'], $extent 
['x2'], $extent['y2']);

                 $extent_obj = ms_newRectObj();
                 $extent_obj->setExtent($extent['x1'], $extent['y1'],  
$extent['x2'], $extent['y2']);
         }

         else {
                 $extent_obj = ms_newRectObj();
                 $extent_obj->setExtent ($map->extent->minx, $map- 
 >extent->miny, $map->extent->maxx, $map->extent->maxy);
         }


$max_extent_obj = ms_newRectObj();
$max_extent_obj->setExtent (7510802, 548620, 7827464, 783920);

$zoom_factor = -4;
$map->zoompoint($zoom_factor,$point_obj,$map->width,$map->height, 
$extent_obj,$max_extent_obj);


------------------------
Nostalgia isn't what it used to be.



More information about the MapServer-users mailing list