Putting it all together

Now, we'll connect the Google Sheets feed with our Mapbox tiles service in our final application.

Parsing the sheets JSON feed

Previously, we parsed the JSON feed with jQuery for each loop to print two attribute values for each element. Now, we'll remap the feed onto an object that we can use to look up data for the geographic objects triggered in UTFGrid. Review the following code, to see how this done:

// Create a data object in public scope to use for mapping // of JSON data, using id for key var d = {}; // url variable is set with code from previous section // url contains public sheet id $.getJSON(url, function(data) { var entry = data.feed.entry; var title = ''; $(entry).each(function(index, value){ // Column names are ...

Get QGIS: Becoming a GIS Power User now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.