Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#2300 closed defect (fixed)

PHP MapScript's zoomScale(): scale difference in 5.0?

Reported by: dmorissette Owned by: dmorissette
Priority: normal Milestone: 5.0 release
Component: MapScript-PHP Version: svn-trunk (development)
Severity: normal Keywords:
Cc: assefa

Description

Bart van den Eijnden wrote to mapserver-users:

Hi list,

I was surprised to get a different scale back in 5.0 than in 4.8. I tracked it down to the following difference in mapscale.c:

4.8.4:

md = width/(resolution*msInchesPerUnit(units, center_y)); /* was 
(width-1) */

5.0:

md = (width-1)/(resolution*msInchesPerUnit(units, center_y)); /* 
remember, we use a pixel-center to pixel-center extent, hence the width-1 */

But PHP/Mapscript's zoomscale function does not seem to deal correctly with this new change:

from Chameleon's map_navigator:

        // call the zoomscale function
        echo $nScale;
        $this->oSession->oMap->zoomscale($nScale, $oPixelPos,
          $this->oSession->oMap->width, $this->oSession->oMap->height, 
$oRect);
        echo '<br/>'.$this->moMapObject->oMap->scale;

will output:

4278<br/>4287.52783964

Best regards,

Bart

Change History (4)

comment:1 by dmorissette, 17 years ago

That's probably related to ticket #2166 (on which I was CC'd with the wrong user id). I'll have a look now.

comment:2 by dmorissette, 17 years ago

Resolution: fixed
Status: newclosed

The code in php_mapscript.c had to be modified to use width-1 the same way as was done for msCalculateScale() in ticket #2166.

This is fixed in r6872.

comment:3 by sdlime, 17 years ago

Is there anyway to make trac use valid user ids????

Steve

comment:4 by dmorissette, 17 years ago

I have raised a ticket about this: http://trac.osgeo.org/osgeo/ticket/128 Seems that there is no simple fix.

Note: See TracTickets for help on using tickets.