Calculate dinstance between two location

Possible to calculate the distance of two location using coordinate(latitude/longitude)?

e.g
distance(loc1, loc2) = 7.5 meters

Hi, there is no ready function to do this, but you could use the custom JS flow function with some of the algorithms found online.

Found it. thanks

1 Like

@Jhon_Michael_Revilla - can you show me how you were able to get this to work using the javascript code you shared? Interested in seeing your logic as I am attempting to replicate the same thing

still had issue on calculating two distance? @sierge .
please use code above. I didn’t change anything from the original code. just fill the 5 parameters.

in my case I need to calculate the user distance from there branches
I use GPS to get Users mobile device coordinates
image

lat1 = from branch coordinate latitude
lon1 = from branch coordinate longitude

lat2 = from GPS latitude
lon2 = from GPS longitude
unit = M (M for meters, K for kilometers. in my case i need meters)