My data source for a map based on mapbox.js is hosted in a Spreadsheet on Google Drive. Actually I use Geo for Google Docs to export the locations to GeoJSON and Leaflet.markercluster to visualize them on a map.
I need to load the registers directly from Google Drive so changes will be reflected immediately without exporting the data. mapbox.js API has different methods to fullfill this but none of them works for me. So my question is (A) which of them is the preferred one and (B) how I can make this one work:
markerLayer.loadURL() methode loads and shows GeoJSON data but I can't figure out how to directly access Google Drive file in GeoJSON format without exporting it first.
I tried to use jQuery getJSON method but callback doesn't call defined function:
$.getJSON("https://spreadsheets.google.com/feeds/list/KEY/od6/public/basic?alt=json-in-script&callback=loadMarkers");
markerLayer.setGeoJSON(): I published the spreadsheet as CSV and used csv2geojson to convert it to GeoJSON similary to Loading CSV into Markers example. Using the following code I get an TypeError: t is undefined error at line 5 of mapbox.js.
$.ajax({ url: 'https://docs.google.com/spreadsheet/pub?key=KEY&output=csv', success: function csvLoad(csv) { markerLayer.setGeoJSON(csv2geojson.csv2geojson(csv, function(err, data) { })); } });
Thanks for the help.