Distance from address to current users location

So I’m creating a directory app and I’m trying to display the current users distance from an address. I’ve tried the IP Geolocation and I can’t seem to get it to work. Any ideas on how to get the current users location and get bubble to calculate the distance to an address?


Use the map element with the center map option set
Set a field of type geographic location and call it prior location to the user data type, and a second one called current location of type geographic location
Place a button and call it first location, a second button called current location and a third button called distance
Build the logic so that when the button first location is pressed the maps location is recorded on the user’s field first location, also when the second button current location is pressed to record the user’s current location. You can center the maps marker by centering it in the place you want to set the respective location.
Forgot to mention to create a number field in the user data type of type number and call it distance.
Finally, build a workflow upon the click of the button distance to create the distance in the user’s distance number field between both locations by using the operator :distance from (this one shows if the fields locations are of type geographic location.

The above is an unrealistic way to approach it for your app but hopefully is somewhat illustrative as to how to derive the distance.

Hope this helps :+1:t2:

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.