Skip to content

Instantly share code, notes, and snippets.

@st0rmy29
st0rmy29 / Code.gs
Created April 26, 2020 19:59 — forked from takvol/Code.gs
Find distance and driving time between locations stored in google spreadsheet by using Distance Matrix API
function onOpen() {//adds new menu item to active spreadsheet
var sheet = SpreadsheetApp.getActiveSpreadsheet();
var entries = [
{name : "Calculate distance", functionName : "findDistance"},
{name : "Clear distance", functionName : "clearIDs"}];
sheet.addMenu("Distance measure", entries);
}
function clearIDs() {
var sheet = SpreadsheetApp.getActiveSpreadsheet();