Implementing a Javascript -based Google Maps popup via a button?

  • 1.  Implementing a Javascript -based Google Maps popup via a button?

    Posted 02-26-2018 16:36
    Just wanted some feedback on this idea I'm working on. I have a block of mixed code that performs a Distance Matrix query to Google Maps based on multiple origins and a single destination (idea is to find the closest service tech employee to a given customer). It's a modified version of the example found here (modifed meaning that it does a few additional/different things than what's in the example), and I'd be willing to provide the source upon request.
    Right now, I'm looking to try and insert this as a new button column in our Customers table, if possible, so that front office employees can click it and, within seconds, be able to see our closest technician and know who to put down when it gets scheduled. I've looked into Dan's IOL mechanism for getting JS into Quickbase but am not 100% sure it would work for my case since there's some CSS/HTML in there as well that's necessary to actually display the map with the locations on it for a visual guide. 

    So, my main questions are:

    1) Is it possible to have all of this contained in a button, or would I need to make this appear as a separate section on the individual customer's page since there's stuff other than JS in the code block?

    2) If I was to use this technique, how would I go about transferring fields from QB as variables in the JS code? I can hard-code all of our techs in beforehand, but I need the button to pull that specific customer's address and set it as the destination a la:

        var destination = '[Customer Address]'