Searches by geolocation

Searches by geolocation

GstgGstg Posts: 66Questions: 4Answers: 0

We are utilizing Datatables quite extensively. We have been tasked with doing geolocation searches for customers in a 50 mile radius. I was wondering if anyone had done anything like that before? We could store Latitude and Longitude, and potentially utilize an algorithm that determines if one location is within the radius of another, but is there anyway that it could be done in a fast search? I am fairly well versed in PHP more so than Java, if that makes a difference.

Thanks ahead of time for your time

Replies

  • kthorngrenkthorngren Posts: 21,315Questions: 26Answers: 4,948

    One option is to use the server to perform the search. Use ajax.data as a function to send the search term(s) to the server. When the user performs the search us ajax.relload() to fetch the filtered data.

    Another option is to have all the rows at the client and use search.fixed() or column().search.fixed() to search the Datable based on the search term(s). See this example. You will need to add the logic to handle the 50 mile radius search.

    Kevin

Sign In or Register to comment.