I have two variables:
const userPos = { lat: 68.39918004344189, lng: -55.54687500000001 }
const solution = { lat: 58.722598828043395, lng: -36.92504882812501 }
I need to get the distance between the two. What I tried was:
userPos.distanceTo(solution)
Also:
distanceTo(userPos, solution)
Also:
const userPosLng = userPos.lng
userPosLng.distanceTo(solution.lng) //tried both with .lat as well
and finally:
const userPosLng = userPos.lng
distanceTo(userPosLng, solution.lng)
None of these worked, and only these were what I found in the documentation and on the internet. So I am now out of ideas, and I would appreciate some help.