Timemap.js v.2.0.1

Class TimeMap.loaders.gss

Extends:
TimeMap.loaders.jsonp
Requires:
param.js
loaders/json.js
Defined in:
google_spreadsheet.js
See:
Google Spreadsheet Example
Google Spreadsheet Example, Arbitrary Columns

Google Spreadsheet loader.

This is a loader for data from Google Spreadsheets. The constructor takes an optional map to indicate which columns contain which data elements; the default column names (case-insensitive) are: title, description, start, end, lat, lon

See http://code.google.com/apis/spreadsheets/docs/2.0/reference.html#gsx_reference for details on how spreadsheet column ids are derived. Note that date fields must be in yyyy-mm-dd format - you may need to set the cell format as "plain text" in the spreadsheet (Google's automatic date formatting won't work).

The loader takes either a full URL, minus the JSONP callback function, or just the spreadsheet key. Note that the spreadsheet must be published.


TimeMap.init({
    datasets: [
        {
            title: "Google Spreadsheet by key",
            type: "gss",
            options: {
                key: "pjUcDAp-oNIOjmx3LCxT4XA" // Spreadsheet key
            }
        },
        {
            title: "Google Spreadsheet by url",
            type: "gss",
            options: {
                url: "http://spreadsheets.google.com/feeds/list/pjUcDAp-oNIOjmx3LCxT4XA/1/public/values?alt=json-in-script&callback="
            }
        }
    ],
    // etc...
});

Constructor

TimeMap.loaders.gss(options)

Static Methods

Method
TimeMap.loaders.gss.setParamField(param, fieldName)
Set a parameter to get its value from a given Google Spreadsheet field.

Fields

Field
Inherited from TimeMap.loaders.remote
opts :{String}
Object to hold optional settings.
Inherited from TimeMap.loaders.base
scrollTo :{String|Date}
Date to scroll the timeline to on load

Methods

Method
Inherited from TimeMap.loaders.base
cancel()
Cancel the callback function for this loader.
Inherited from TimeMap.loaders.base
getCallback(dataset, callback)
Get a callback function that can be cancelled.
Inherited from TimeMap.loaders.base
getCallbackName(dataset, callback)
Get the name of a callback function that can be cancelled.
Inherited from TimeMap.loaders.remote
load(dataset, callback)
Load function for remote files.
Inherited from TimeMap.loaders.base
parse()
Parser function to turn a string into a JavaScript array
Preload function for spreadsheet data
Transform function for spreadsheet data
Class Detail
TimeMap.loaders.gss(options)
Parameters (optional)
options {Object} All options for the loader:
options.key {String} Key of spreadsheet to load, or
options.url {String} Full JSONP url of spreadsheet to load
options.paramMap {Object} Map of paramName:columnName pairs for core parameters, if using non-standard column names; see keys in TimeMap.loaders.base#params for the standard param names
options.extraColumns {String[]} Array of additional columns to load; all named columns will be loaded into the item.opts object.
options[...] {mixed} Other options (see TimeMap.loaders.jsonp)
Static Method Details
TimeMap.loaders.gss.setParamField(param, fieldName)
Set a parameter to get its value from a given Google Spreadsheet field.
Parameters (optional)
param {TimeMap.Param} Param object
fieldName {String} Name of the field
Method Details
preload() :{Array}
Preload function for spreadsheet data
Returns:
{Array} data Array of item data
transform() :{Object}
Transform function for spreadsheet data
Returns:
{Object} data Transformed data for one item
©2010 Nick Rabinowitz
Documentation generated by JsDoc Toolkit 2.3.2 on Sat Aug 06 2011 13:40:07 GMT-0700 (PDT)