Google My Maps and Location History

Thanks @AliFarahat but that is the trouble I do not know what value to set. If I manually input imperial or metric I get the correct data showing. What value do I set to make it dynamic. The field in the User data type and that is saved in the user data base is called “units”. If I set the value to units I do not get the correct response. What do I set the value at?

I changed the example to reflect the unit selector. I think it is case sensitive so in this case i show it as Metric but i dynamically change it to metric

1 Like

Thanks @AliFarahat that works. If I then wanted to take it a step further and have the dropdown automatically change to the Current Users units I thought this might work but I don’t know where to go next

or have I gone about this wrong??

Create a field on the user level called units as a text
On the user profile page have the drop down with static values that saves the user pref as text in the units field
On the API connect select current user units as the dynamic value

1 Like

Wow @AliFarahat - that worked - fantastic :grinning: I will await your next update re the code for multiple stops - when you get a chance to dig it out

1 Like

Here is a link to the post for multiple stops.

Thanks so much @AliFarahat this is really appreciated. I have not had a chance to look at it in detail yet to see how you did it but on the surface it looks just what I need. This community is fantastic in what you all can achieve. I will have a look in detail in the next day or two and get back to you

Hello AliFarahat,

I am trying to calculate a distance using the Google API and the distancematrix but i did’t get any results …

I have configured the Google API as explained by Neerja here : How do resolve the Google MAP error: “API keys with referer restrictions cannot be used with this API.”? - #14 by neerja

I am able to see the map and draw the route, but when I am using the distance Matrix, i have only a white screen …

Here is my HTML element :
33

Also, how is it possible to save this “distance” in bubble ?

Thanks a lot for your help.

Audric

@audric.guillemin

Please look here for examples

1 Like

Hello @AliFarahat,

Thx for your answer. I have downloaded your plugin and try to configure it, but i still get some problem …

As you did in your example, I tried to do the same configuration. I tried with the state I fixed, and with latitude and longitude, but both way are not working.

In my text element Q, Google Map API is still red, as there is something missing … but in your example it’s not the case.

14

I aslo tried to set a state with the value, but I have the same problem …
00

Do you have an idea what might be the problem ?
Thanks for your help,

Ok so these are easy. On “Text Q” in the above image you have to click more just as in the example i provided

image

As for the state, you have to tell bubble what state data type this will hold. Like here

or here

Hello Ali,

Thank you again for your answer, however, it is still not working with your solution …

I tried another way without using the data of my app but with new one like this :

Capture d’écran 2019-11-29 à 16.56.28.png

and I set up a state like this type : Distance & Duration (its not working if I make it a list).

Capture d’écran 2019-11-29 à 16.56.17.png

And in the text box I am displaying the distance value like this :

Capture d’écran 2019-11-29 à 17.00.44.png

However, when I am running the app, nothing appears, and when I am looking in the debugger, it says origin and destination addresses are empty …

Capture d’écran 2019-11-29 à 17.01.45.png

I tried to put the address input directly, then with latitude and longitude. But both ways are not working …

Your help on this would be appreciated a lot 🙏🙏🙏

Thanks you very much in advance for your answer,

Audric

EDIT : Problem solved. I set a state for each adress (origin and destination) in the Google Maps API and its finally worked !

I still have a question for you @AliFarahat :slight_smile: Now that I have a value for the distance, how can I save it as a “number” ? I would like to use this data to calculate the total km of a trip.

Hi Ali,
I am a newbie to Bubble and would like to seek your advice on the distance and duration solution you had provided previously. I did an exact copy of your solution to my test app but when I ran the app, it didn’t return any values, see below screen captures:


Below is the screen capture after running the app and as you can see, no results were returned:

Appreciate your help and advice on where I could have done wrong.
Thanks much,
Leon

Hi I can’t open the links, can I have the HTML? Thanks