[mapserver-users] PHP/MapScript: mapObj->scale

Doyon, Jean-Francois Jean-Francois.Doyon at ccrs.nrcan.gc.ca
Fri Feb 15 14:26:50 EST 2002


Hello,

I'm trying to get the current scale of a map in PHP/Mapscript, but it
allways returns -1 !

Here's the code:

<?
        
dl('php_mapscript.so');
        
$layers = $HTTP_GET_VARS['layers'];
        
$map = ms_newMapObj('/home/mapdata/regional-lens/mapfile.map');
        
foreach ( $layers as $layer ) {
        $layerobj = $map->getLayerByName($layer);
        $layerobj->set('status',MS_ON);
}
          
$map->preparequery();
$scale = $map->scale;

$image = $map->draw();

$image_url = $image->saveWebImage(MS_GIF,1,1,100);
  
?>

I tried both with and without the preparequery(), and I allways get -1 ...

What am I missing here?

Thanks!

Jean-François Doyon
Internet Service Development and Systems Support
GeoAccess Division
Canadian Center for Remote Sensing
Natural Resources Canada
http://atlas.gc.ca
Phone: (613) 992-4902
Fax: (613) 947-2410




More information about the mapserver-users mailing list