[Cartoweb-users] Wrong measurement unit

Dirk Jesko ml.dje at geocontent.de
Mon May 7 09:47:42 EDT 2007


Hi Oliver,

thanks. Now I see the problem. It is a problem in the JavaScript part. 
In dhtmlInit.js, the content of the distance and surface tags are read 
from the document tree into variable. If the scale is changed via Ajax 
request, these variables are not updated and the units therefore stay at 
their old values. I think the easiest but possibly not the best way will 
be to set the unit together with the value in dhtmlInit.js instead of 
setting it in the template.

Regards,
Dirk



Oliver Christen wrote:
> the "factor" value seems to be set in ClientLocation.php, function 
> renderFormPrepare
>
> it is set as follow
>        $scaleUnitLimit = $this->getConfig()->scaleUnitLimit;
>        if ($scaleUnitLimit && $this->locationResult->scale >= 
> $scaleUnitLimit)
>            $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 ?
>
> regards
> Oliver
>
>
>> 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