Displaying journey time for both driving and public transport

Hi Everyone,

I would like to display the journey time for both driving and public transport as displayed below.

I would have the users postcode and the postcode of the listing as part of the dataset.

Is there a simple way to do this?

1 Like

Yes, you can build something that integrates both public transit and car driving time using @AliFarahat’s plugin. It’s a bit tricky getting started, but let me know if you need help and I’ll pull together some documentation. (Note: you need your own Google Maps API keys for this plugin).

The Bubble plugin will give you estimates. But (as far as I know), doesn’t allow for mode of transportation, so it defaults to driving.

Hi Dan,

Thanks for getting back to me. I have managed to generate my own API Key, but I am lost as to how to get this to work in bubble. I have downloaded the plug-in and began playing around with it. Unfortunately I haven’t been able to get it to work yet and the links provided in the plugin page aren’t really useful.

Id be so grateful if you were able to instruct how to do it. Or even point me in the right direction.

I could either look at User’s postcode or User’s current location as the origin and the Postcode of the employer as the destination. As mentioned earlier I would like to display the amount of time spent travelling for both driving and public transport.

Best regards,

Mike

Hey Mike - have you gotten to the “Get Data from an External API” step of getting things set up? Your setup should look fairly similar to this below. (Note: you’ll set up the Get Data from an External API twice. The variable you will change is “mode” - driving for driving, transit for transit).

Note: you can use “Current geographic position” for the origin or a pre-set address.

1 Like

Hi Dan,

Thanks for the help.

Yes this bit I have done, it’s what to do with the API Key, where to put it etc that I am struggling with now. There seems to be one API Key, but I am not sure what to do with it?

Take the API key and paste it in all of the fields you showed. (Note: be sure to keep your API key(s) secret, no need to post here :slight_smile: ).

I have pasted the API Key into all of the fields and set up the ‘Get data from API’ as you have done in your earlier post.

When I run in the preview it doesn’t seem to be pulling any data and the space is left blank?

Is yours working?

Thanks,

Mike

Maybe I screwed up the API Key bit. It says ‘request denied’ in the debugger under status?

Hi Everyone,

Problem now solved. The issue was I had not activated the Distance and Duration Key in the Google Console.

A couple of questions;

  1. Google are asking me to restrict the key, do I need to worry about this at this stage? I do not understand what to do here.
  2. I have not connected any payment methods yet within the Google console but see mention of ‘Billing’. How much does it cost to use this? I don’t want to be racking up any large bills. Or any bills for that matter.

Thanks for your help.

Mike

Im not out of trouble just yet


In preview mode its taking roughly 60 seconds for the times to load. Everything else loads instantly when I click refresh, but the durations only pop up about a minute later.

Any ideas?

@AliFarahat - for the Maps plugin, @m.lewis makes a good point. Would likely be helpful to prompt a bit further on the need to activate in the Google console and steps for doing so on the plugin info page.

  1. At this stage, it is likely not necessary to restrict the key, just keep it private. As you get further into the development process (and have defined domain names, etc, then worth restricting).
  2. Google is fairly generous with their APIs for the free tier. Unless you explicitly enabled it, you will be on the free tier. Beyond that, the costs are fairly minimal.

Hello @dan1 and everyone

The maps plug-in will go through a round of updated in several weeks. We will improve documentation and create demo and support page for it when that happens.
I know it can be a bit frustrating to get everything setup for this plug-in but once you do it’s almost problem free.
If anyone needs help please DM me

1 Like

Hi @AliFarahat , thanks for the response.

I am having an issue whereby the data is displayed only sometimes when in run mode. I can’t figure out the issue when looking at the debugger. It just displays data sometimes, and sometimes doesn’t


I appreciate I haven’t given you much to go off.

Mike

Can you share the call parameters your using

If I remember correctly to origin and destination must be lat,long coordinate