Home › Forums › Front-end Issues › WP Query closest locations by ACF Google Map values › Reply To: WP Query closest locations by ACF Google Map values
To do that you would need to have a database full of locations or do the math to do all the calculations based on the longitude and latitude. Without some type of database you’d need to get all the posts/fields and do the calculations 1 at a time? Sorry I can’t give you more help than that https://stackoverflow.com/questions/27928/calculate-distance-between-two-latitude-longitude-points-haversine-formula.
I use the pro/gold version of WP Google Maps, it does all of this for me https://www.wpgmaps.com/purchase-professional-version/
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!