Summer Vacation Map

September 26, 2017G Suite Add-ongoogle apps script, google maps, teacher tools, collaboration, summer vacation, feedback, visual

This is a project that I built for a part of a demo slam with Ceci Gomez-Galvez at the Shekou Summit.

This is a longer project that I usually post so feel free to ask questions below. I really want to hear from other educators about how to use this kind of tool to direct instruction.

The first thing you need is to create a form as I did in the video. Then make sure you create a trigger like below. This will ensure that everytime someone submits your form, it grabs the geo-codes for that city.

Code.gs

function submitTrigger(e) {
  var range = e.range;
  var vals = e.values;

  var response = Maps.newGeocoder().geocode(vals[3]);

  var geoCodes = [
    response.results[0].geometry.location.lat,
    response.results[0].geometry.location.lng,
  ];

  //Make sure that you put the geoCodes variable into square brackets
  //The setValues method expects to have a multi-dimensional array.
  SpreadsheetApp.getActiveSheet()
    .getRange(range.getRow(), 5, 1, 2)
    .setValues([geoCodes]);
}
jordan rhea

Jordan Rhea - I’m a front-end web developer. Follow me at @rheajt if you want to talk, discuss, or fix any of my code! I am passionate about using JavaScript in Google projects, but there are many more applications. I want to learn them all.