10

We're starting to work with 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:

Example-google-spreadsheet

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:

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.

tehhowch
  • 9,645
  • 4
  • 24
  • 42
CarlosGarcia
  • 153
  • 1
  • 6

0 Answers0