I don’t understand the question or you don’t understand OH. You would define two Location Items and they will be populated somehow (Own Tracks?). In a rule you then use:
val distanceM = (myLocation1 as LocationItem).distanceFrom(myLocation2 as LocationItem)