how can we access distance field?
hcyildirim opened this issue · comments
Hi, I want to show the distance between the locations that exist in the database of latitude and longitude values I sent to the query. How can we access this distance information?
example:
@locations = Location.within(5, :origin => @somewhere)
distance value should be calculated by @somewhere
coordinates and returns like below:
{
"data": [
{
"name": "Paris",
"distance": "200 meters"
},
{
"name": "New York",
"distance": "2000 meters"
}
]
}
There is a patch in #56