Timemap.js v.1.6

Class TimeMap.loaders.jsonp

Extends:
TimeMap.loaders.remote
Defined in:
json.js

JSONP loader - expects a service that takes a callback function name as the last URL parameter.

The jsonp loader assumes that the JSON can be loaded from a url to which a callback function name can be appended, e.g. "http://www.test.com/getsomejson.php?callback=" The loader then appends a nonce function name which the JSON should include. This works for services like Google Spreadsheets, etc., and accepts remote URLs.


TimeMap.init({
    datasets: [
        {
            title: "JSONP Dataset",
            type: "jsonp",
            options: {
                url: "http://www.example.com/getsomejson.php?callback="
            }
        }
    ],
    // etc...
});

Constructor

TimeMap.loaders.jsonp(options)

Fields

Field
Inherited from TimeMap.loaders.base
scrollTo :{String|Date}
Date to scroll the timeline to on load
Inherited from TimeMap.loaders.remote
url :{String}
URL to load

Methods

Method
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.
load(dataset, callback)
JSONP load function.
Inherited from TimeMap.loaders.base
parse()
Parser function to turn a string into a JavaScript array
Inherited from TimeMap.loaders.base
Function to call on data object before loading
Inherited from TimeMap.loaders.base
Function to call on a single item data object before loading
Class Detail
TimeMap.loaders.jsonp(options)
Parameters (optional)
options {Object} All options for the loader:
options.url {String} URL of JSON service to load, callback name left off
options[...] {mixed} Other options (see TimeMap.loaders.remote)
Method Details
load(dataset, callback)
JSONP load function. Creates a callback function and adds a script tag with the appropriate URL to the document, triggering the HTTP request.
Parameters (optional)
dataset {TimeMapDataset} Dataset to load data into
callback {Function} Function to call once data is loaded
©2010 Nick Rabinowitz
Documentation generated by JsDoc Toolkit 2.3.2 on Thu Jun 24 2010 13:58:02 GMT-0700 (PDT)