All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

distance filter by meters

Jokhab 16 Apr 2015 12:36 question, complete

Hello Low.
I would like to ask how to get the result shows the distance by meter not by KM or Mi.
I already know that you support these 2 units only.
But I would like to add custom unit.
can you help me to do this ?
[License Key is has been sent to (hi) email]

Replies

  1. Low 16 Apr 2015 12:43

    Not supported, but you can hack it in. Open up lsf.distance.php and look up line #87, which should be empty (and part of a switch-statement).

    On that line, add this, pushing the rest down:

    case 'm': 
    $R = 6371000;
    break;


    Then you should be able to use distance:unit="m" for meters.

  2. Jokhab 16 Apr 2015 12:49

    thanks alot Dear low
    you are the best

  3. Jokhab 16 Apr 2015 13:21

    thats work fine.
    many thanks to you?
    are planning to add this improvement in the next version ? so we dont delete if from the original file?

  4. Low 16 Apr 2015 13:27

    Sure, no harm there, I guess.