Discussions

Expand all | Collapse all

Google Distance Matrix API

  • 1.  Google Distance Matrix API

    Posted 04-20-2017 17:28
    I would like to see if there is a way for me to create an API that will call into Google Distance Matrix API and return the distance a worker's home is from the job site. I was able test the API in Postman but I am having a hard time adding it to Quickbase. Not sure if I should do this with a formula URL field or a webhook


  • 2.  RE: Google Distance Matrix API

    Posted 04-20-2017 17:36
    Generally this requires custom coding depending on your exact needs.  

    Are you looking to just have a button that pulls up the map w/ directions?   (this is an easy button, that I can share if needed)

    Or something that is automatic when a worker is assigned to a job site?  (This is much more advanced)


  • 3.  RE: Google Distance Matrix API

    Posted 04-20-2017 17:55
    The first button sounds interesting if you are willing to share it I would love to see how it works!  Thanks!


  • 4.  RE: Google Distance Matrix API

    Posted 04-20-2017 17:40
    Matthew,
    Thanks for your resoonse!
    I am looking for something that will go to google and get the distance when a worker is assigned to the job. Can you give me some pointers?


  • 5.  RE: Google Distance Matrix API

    Posted 04-20-2017 18:18
    https://developers.google.com/maps/documentation/javascript/3.exp/reference">https://developers.google.com/maps/documentation/javascript/3.exp/reference">https://developers.google.com/maps/documentation/javascript/3.exp/reference

    This is something we have done several times.  If you need help implementing this on your app, feel free to contact me ( Matthew@cirrusops.com) or another QuickBase Developer if you choose.


  • 6.  RE: Google Distance Matrix API

    Posted 04-20-2017 18:22
    Thank you!


  • 7.  RE: Google Distance Matrix API

    Posted 04-20-2017 18:12
    Directions Button,

    This is formula URL button:

    "https://www.google.com/maps/dir/"&URLEncode([Resource - Home Address])
    &"/"&URLEncode([Project Location])

    This is just a URL Button that will go to google maps.  Both of those field are full address fields being referenced.


  • 8.  RE: Google Distance Matrix API

    Posted 04-20-2017 18:17
    Thank you!
    Any way I could get you to point me in the right direction for the automated way?
    Can I use a webhook to get the information and then post it somehow on to a field?
    Again, thanks for taking the time to help me!!


  • 9.  RE: Google Distance Matrix API

    Posted 04-20-2017 18:21
    I agree with this is there anyway to enter two addresses on the QuickBase record and have the Google API calculate the distance and then have it shown on the QuickBase record? 


  • 10.  RE: Google Distance Matrix API

    Posted 04-20-2017 18:27
    Yes, I do it with a code page.


  • 11.  RE: Google Distance Matrix API

    Posted 04-20-2017 18:43
    We are all hoping for a day soon where QuickBase exposes the "geocoding" (lat & long) of an Address field to use as an automatically populated field associated with an Address field.  When that day comes, this will be a lot easier to calculate the distance - not the driving distance, but at least the "as the crow flies" distance - a straight line.


  • 12.  RE: Google Distance Matrix API

    Posted 04-20-2017 18:53
    This is easy to do with script. I have to travel now but I will either post an example I did earlier or create a new demo.

    Trivia: Most of you probably don't know that my business is named after the esoteric trigonometric function haversine which is used in calculating the great circle distance between two points on a sphere:



    https://en.wikipedia.org/wiki/Haversine_formula

    Numb3rs Scene: Everything is numbers, Math is everywhere
    https://www.youtube.com/watch?v=vFRTgr7MfWw">https://www.youtube.com/watch?v=vFRTgr7MfWw">https://www.youtube.com/watch?v=vFRTgr7MfWw


  • 13.  RE: Google Distance Matrix API

    Posted 04-20-2017 18:58
    I know... It would be great if they would at least add some Trig functions in there (Sin, Cos...) that way we could use them to calculate as crow flies.


  • 14.  RE: Google Distance Matrix API

    Posted 04-20-2017 19:01
    An example would be great! 

    Thank you!


  • 15.  RE: Google Distance Matrix API



  • 16.  RE: Google Distance Matrix API

    Posted 04-20-2017 19:17
    This is awesome! The earth is flat... The people in the middle ages were right after all :)
    I'll try your approach.

    Thank you!


  • 17.  RE: Google Distance Matrix API

    Posted 04-20-2017 21:39
    The Earth is an oblate spheroid.