Radius Calculation - Distance between two users

Need help using map to connect users. I currently have a “Radius” box, and when a number is entered, the map will only generate users within that given number of miles. Great. If I enter “5” I will only find users up to 5 miles away from my GPS point. Because I am only willing to travel a max of 5 miles. But there’s a problem

But what if User #2 is also willing to travel only 5 miles, but is exactly 5 miles away from the farthest point I’m willing to go? I want to include that possible person to meet that is 10 miles away, but I’m only willing to meet them halfway. If they are technically unwilling to travel any more than 4.5 miles, I don’t want them to show up on my map…

Is there a calculation for this when using maps & radius to connect to people?
Any help is greatly appreciated!

Thanks!

You may either use Google Maps API - if you will have not that many requests you may fit into their free tier.

Or you can use this free plugin Ultimate Toolkit Plugin | Bubble - Action “Distance”. It takes two coordinates and returns the direct distance between them.

You may also combine these two approaches: use Google Maps API for getting users’ coordinates and Toolkit plugin for calculating distances.

I’ve built a couple of apps solving similar problem. It is feasible.

1 Like

Thanks shpak.serhiy, I’ll give this a try. I am using Google Maps API now, and it seems to be working. I’m going to try this toolkit though. Thanks again!