[Cartoweb-users] Wrong measurement unit

Oliver Christen oliver.christen at camptocamp.com
Mon May 7 06:29:39 EDT 2007

the "factor" value seems to be set in ClientLocation.php, function 

it is set as follow
        $scaleUnitLimit = $this->getConfig()->scaleUnitLimit;
        if ($scaleUnitLimit && $this->locationResult->scale >= 
            $factor = 1000;
        else $factor = 1;

scaleUnitLimit is get from location.ini
then a comparaison is done between the scaleUnitLimit and the current scale 
of the view.

did you try to change the scaleUnitLimit value in location.ini ?


> Hello,
> when measuring, I always get the same unit (km), while the value of the 
> measurement changes between km to m at a scale of 1:10.000 (as set in the 
> ini file). The template has a condition that changes between 'm' and 'km':
> <div id="floatDistance" class="locationInfo">{t}Dist approx.:{/t}%s{if 
> $factor == 1000} km{else} m{/if}</div>
> However, I can not figure out why the $factor is obviously not set 
> correctly or where (in the php code) it is set at all.
> Thanks for any help,
> Dirk
> _______________________________________________
> Cartoweb-users mailing list
> Cartoweb-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/cartoweb-users

More information about the Cartoweb-users mailing list