Hello, I am working on a clients website and need to develop a quote.
Part of this quote will be determined by the travel distance between two locations: Pickup & Dropoff.
Pickup Address Input is: #addressInput1
Dropoff Address Input is: #addressInput2
Both address inputs have been connected to a google API Key.
The API is successfully showing address information “powered by google”
The Problem:
I cannot figure out how to call this data successfully. I have spent 2 weeks trying my best to research solutions to no avail.
Also, I have triple checked my Google API to ensure my billing is setup and necessary API’s are enabled.
Here is the code i have put together referencing the following forum posts:
https://www.wix.com/corvid/forum/community-discussion/google-distance-matrix-api
PAGE CODE:
BACKEND CODE
This is the current error:
it states I am not using API’s to authenticate requests. But my attempts are being recorded on the google console
also, on my BACKEND CODE:
THE FOLLOWING LINE:
const url = “https://maps.googleapis.com/maps/api/distancematrix/json?origins=Vancouver+BC|Seattle&destinations=San+Francisco|Victoria+BC&” + key;
Im sure would have to be updated, as it is specific to Seattle & San Francisco. But I am not sure what URL to reference for a general location lookup.
I have provided as much details as possible im hopes someone can help me sort through this “kink”.
I would appreciate any and all feedback! Thanks in advance to my Wix Gurus!