Ticket #2300 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

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

Reported by: dmorissette Assigned to: 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

09/10/07 10:22:52 changed by dmorissette

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

09/10/07 10:46:42 changed by dmorissette

  • status changed from new to closed.
  • resolution set to fixed.

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.

09/10/07 12:45:10 changed by sdlime

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

Steve

09/10/07 13:15:07 changed by dmorissette

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