- I am trying to execute a static map from a cell on a google sheet via a google script. My end goal is to load my own map (contained in a .kmz that was downloaded from google my maps) and display a pin to locate a user-defined zone (colored polygon on map).
I have an API key already set up from previous mapping tasks.
function getZone() {
var app = SpreadsheetApp;
var ss = app.getActiveSpreadsheet().getActiveSheet();
var address = ss.getRange("A1").getValue();
var testMap = Maps.newStaticMap().addMarker(address);
ss.getRange("B1").setValue(testMap.getMapUrl());
}
I then receive this error when I click on the link in my spreadsheet:
The Google Maps Platform server rejected your request. You must use an API key to authenticate each request to Google Maps Platform APIs. For additional information, please refer to http://g.co/dev/maps-no-account
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…