We're starting to work with google-apps-script and Google Apps in general where I currently work. I've been searching and searching in Stack Overflow to try to solve this problem:
We have a Google Spreadsheet in which we calculate the total distance between the different points in a route. Something like this:
In my Apps Script, I have this piece of code:
var directionFinder = Maps.newDirectionFinder();
directionFinder.setMode(Maps.DirectionFinder.Mode.DRIVING);
directionFinder.setOrigin(origin);
directionFinder.setDestination(destination);
I run the function and sometimes works and sometimes don't. What annoys me is when I go to my Google Cloud Console, in my API administration, I don't see any API usage - it's like nothing happened, even if I have enabled the API.
I know my question is exactly the same as in these links:
Maps.newDirectionFinder() Exceeded Daily Request Quota
In this link I don't understand how I can add my API to the request like the error info recommends.Set Maps API key in Script Editor
In this one, the code worked for me and I see movement in my API administrator.
The thing is, is it possible to do it using the Maps
method and not using UrlfetchApp
? Currently using Maps
, I don't see anything happening and it works whenever it wants.
I have seen there is a method in Maps
, something like:
Maps.setAuthentication(clientId, signingKey)
I tried putting here my projectId
and API key, but I think it did nothing.