Forum Academy Marketplace Showcase Pricing Features

How to calculate driving distance from user's current location?

Hi there,

I am building an app that needs to calculate the driving distance between a user’s current location and an address that I have in the Bubble database.

Right now, it is currently working as a straight line (as the crow flies) but that is not always the closest or best location if you are driving. This is the request I am currently using:

Current cell’s Landmark’s Address distance from Current geographic position:formatted as 1028.6km

I am pretty sure the way to calculate driving distance is using the Google maps API. I have gone ahead and created the API keys in the Google developer console but after that I am stuck.

Can someone show me how to use the Google Maps API to return a driving distance, instead of a straight line. Is a plugin required? Or can I directly hit the Google Maps API to get this information?

If there is a video or tutorial that outlines this the process for this, or if you have ideas on how to do this and you’re able to share, it would be greatly appreciated.

Thanks in advance and any help is appreciated.


1 Like

Thanks for sharing this resource, Natasha. This certainly set me down the correct path.

1 Like