[Chameleon] scale widget in jsapi mode lagging behind

Bart van den Eijnden bartvde at xs4all.nl
Fri May 13 17:32:29 EDT 2005


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

The problem was in UpdateMap.php (the 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";

I checked the result with the Mapscript calculated scale.

I have opened up a bug for this:

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

Best regards,
Bart

On Fri, 13 May 2005 17:50:08 +0200, Bart van den Eijnden  
<BEN at syncera-itsolutions.nl> wrote:

> Hi list,
>
> Did anyone ever notice this or have a fix for this?
>
> The scale widget is ays lagging one step behind, and apparently this is  
> because goCWCJSAPI.oMap.scale lags one value behind. So at the first  
> zoomin, the scale is not changed. At the second zoom in, the scale from  
> the situation after the first zoomin is displayed.
>
> Also, it would also be a nice enhancment if the scale widget would get a  
> ROUND attribute which determines whether or not values need to be  
> rounded. Now I get values like 58113.3444 which do not represent the  
> accuracy which is to be expected.
>
> Best regards,
> Bart
>
> Bart van den Eijnden
> Syncera-ITSolutions
> Postbus 270
> 2600 AG  DELFT
>
> tel.nr.: 015-7512436
> email: BEN at Syncera-ITSolutions.nl
>
>
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon
>



-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


More information about the Chameleon mailing list