Skip to content

Swapping km for miles

TopPlace has global coverage, and while most of the world uses kilometres as the base measurement, a number of geographies use miles.

The default for TopPlace is kilometres (km). It is possible for configure any template to use miles by adding a small amount of code. It is possible via a callback function.

Add the callback after the loading script where you specify the language. The callback will use the function

“AVUXI.conf.useMiles”, like in the next example:

<script type='text/javascript'>
    var sc = document.createElement('script');
    sc.id = 'vxscript';
    sc.type = 'text/javascript';
    sc.async = 'async';
    sc.src = 'https://m.avuxicdn.com/v3/s/projectcode/en?callback=avapil';
    document.body.appendChild(sc);


    function avapil() {
        AVUXI.conf.useMiles=['en']
    }
</script>
↑