I am doing some basic work with G Sheets and Sheetsee.js library.
I have it working as far as I get my coordinates showing up on a map. I'm using the demo-map file as my starter, I just changed the URL key and added my own column names to optionsJSON function.
My problem is, none of my column data is being called into the pop up template. I cannot find out what I'm doing wrong.
Here's my code for the script part:
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function() {
var gData
var URL = "XXXX_MY-KEY-ID-HERE_XXXX"
Tabletop.init( { key: URL, callback: showInfo, simpleSheet: true } )
})
function showInfo(data) {
gData = data
var optionsJSON = ["name", "message", "image"]
var template = "<ul><li><a href='{{image}}' target='_blank'>"
+ "<img src='{{image}}'></a></li>"
+ "<li>Comment: {{message}}</li>"
+ "<li><h4>Journey: {{name}}</h4></li></ul>"
var geoJSON = Sheetsee.createGeoJSON(data, optionsJSON)
var map = Sheetsee.loadMap("map")
Sheetsee.addTileLayer(map, 'jllord.n7aml2bc')
Sheetsee.addMarkerLayer(geoJSON, map, template)
}
</script>