I am developing a location-based search - it takes a Google autocomplete lat/long. What I want is to order the result list by proximity to the search:
I have the lat/long from Google
Each node has a lat/long
I can loop through each node and calculate the distance from the search input
What I can't work out is how to order the nodes by proximity. I'm guessing I need to hijack the route and create a custom property that is the distance from the search and order by that but I can't see any examples of how to do that.
Sorting nodes / route hijacking
I am developing a location-based search - it takes a Google autocomplete lat/long. What I want is to order the result list by proximity to the search:
What I can't work out is how to order the nodes by proximity. I'm guessing I need to hijack the route and create a custom property that is the distance from the search and order by that but I can't see any examples of how to do that.
Thanks
is working on a reply...