[Chameleon-dev] [Bug 1030] New: scale not updated correctly in jsapi mode

bugzilla-daemon at maptools.org bugzilla-daemon at maptools.org
Fri May 13 17:35:27 EDT 2005


http://www.maptools.org/bugzilla/show_bug.cgi?id=1030

           Summary: scale not updated correctly in jsapi mode
           Product: Chameleon
           Version: 2.2
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core
        AssignedTo: chameleon-dev at lists.maptools.org
        ReportedBy: bartvde at xs4all.nl


The scale used for the Scale widget always lags behind one zoom action. The
problem is both in 2.0.1 as in 2.2 beta.

Okay, finally tracked this one down with Paul's help.

The problem was in UpdateMap.php (BuildHTMLOutputMapExtentsChanged function)
with Mapscript not updating the $oMap->scale correctly, only after a call to
draw() it would update but that's quite inefficient.

So we ended up calculating the scale in PHP instead.

$inchesPerUnit = array(1, 12, 63360.0, 39.3701, 39370.1, 4374754);
$mnScale =
(($oMap->extent->maxx-$oMap->extent->minx)*$oMap->resolution*$inchesPerUnit[$oMap->units])/($oMap->width);

$szResult .= "<input type=\"hidden\" name=\"MAP_SCALE\" value=".$mnScale."> <br>\n";



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


Please do NOT reply to this email, use the link above instead to 
login to bugzilla and submit your comment. Any email reply to this
address will be lost.


More information about the Chameleon-dev mailing list