I’m mentoring a highschool student at Iolani High School in the Robotics department.
Read Part Two if you’re interested in learning how we hacked the Google Maps API.
They’re building an autonomous catamaran to take various readings in the canal to monitor the health of the water source.
The student that I’ve been mentoring was tasked with creating 2 front end webpages for the project.
The first page is meant to take all of the sensor readings and display them on a graph so that other users can visually work through the data.
The second page allows users to tell the catamaran where it needs to travel to next by feeding it a GPS coordinate.
In this blog post I’ll share how we trouble shot the first issue. Read the second part of this story if you’re interested in seeing how we hacked the Google Maps API to get it to do what we needed it to do.
I am having problems passing an array from my html document to a function in google script document.
I attached images of my code, but if it would be easier to view another way please let me know.
In the html document, the getCoord function (lines 110-120) I am cycling through an array of markers. First, I’m checking to see if the markers are visible on the map, then use getPosition to push the coordinates of the marker into an array named coord. I think something is going wrong here, and the array is empty when it gets sent to the google script document in line 81.
Previously, I passed the markers array to the google script document, but I don’t think getPosition works when it is not in the html document. In line 79, I tested getPosition in the html document and it does return the coordinates of the marker.
In the google script code, I want to input the coordinates into a google sheet. I’ve passed strings from the html document to the google script code which were successfully added to the google sheet. So, I think the syntax is correct.
Please email me if you know what may be going wrong or have any ideas about how to get around this.
I traced through the code and sent the following message back: