Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dan Evans 629 posts 1016 karma points
    Feb 15, 2022 @ 15:05
    Dan Evans
    0

    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:

    1. I have the lat/long from Google
    2. Each node has a lat/long
    3. 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.

    Thanks

Please Sign in or register to post replies

Write your reply to:

Draft