[mapserver-users] Setting scale on mapobject

Alexandre Dube adube at mapgears.com
Thu Feb 26 09:26:30 PST 2009


Hi Pietro,

  You could try this (untested):

    $nScaleDenom = 50000; // your scaledenom value
    $oCenter = ms_newPointObj();
    $nX = $oMap->width / 2;
    $nY = $oMap->height / 2;
    $oCenter->setXY($nX,$nY);
    $oMap->zoomscale($nScaleDenom, $oCenter, $oMap->width, 
$oMap->height, $oMap->extent);

  Regards,

Alexandre

Pietro Giannini wrote:
> Hi Anders,
> the mapObject.scale is deprecated, use mapObject.scaledenom. It is the 
> denominator of the scale ratio: if the scale is 1:100000, the 
> mapObject.scale(denom) is  100000.
> This is a read-only property, it cannot be set programmatically 
> because it is set by the mapObject.drawMap() function, but you can use 
> the mapObject.zoomscale() function. Take a look here: 
> http://mapserver.org/mapscript/php/index.html#mapobj-class.
>
> Zoomlevel I don't know, perhaps you refer to zoomfactor, that is a 
> parameter of the mapObject.zoompoint() function.
>
> hth
> bye ...................pg
>
>


-- 
Alexandre Dubé
Mapgears
www.mapgears.com




More information about the MapServer-users mailing list