Timemap.js v.2.0.1

Class TimeMap.loaders.progressive

Defined in:
progressive.js
See:
Progressive Loader Example

Progressive loader class - basically a wrapper for another remote loader that can load data progressively by date range, depending on timeline position.

The progressive loader can take either another loader or parameters for another loader. It expects a loader with a "url" attribute including placeholder strings [start] and [end] for the start and end dates to retrieve. The assumption is that the data service can take start and end parameters and return the data for that date range.


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

TimeMap.init({
    datasets: [
        {
            title: "Progressive KML Dataset",
            type: "progressive",
            options: {
                loader: new TimeMap.loaders.kml({
                    url: "/mydata.kml?start=[start]&end=[end]"
                })
            }
        }
    ],
    // etc...
});

Constructor

TimeMap.loaders.progressive(options)

Methods

Method
load(dataset, callback, start, currBlock)
Load data based on current time
Class Detail
TimeMap.loaders.progressive(options)
Parameters (optional)
options {Object} All options for the loader
options.loader {TimeMap.loaders.remote} Instantiated loader class (overrides "type")
options.type {String} Name of loader class to use
options.start {String|Date} Start of initial date range, as date or string
options.interval {Number} Size in milliseconds of date ranges to load at a time
options.dataMinDate {String|Date} Minimum date available in data (optional, will avoid unnecessary service requests if supplied)
options.dataMaxDate {String|Date} Maximum date available in data (optional, will avoid unnecessary service requests if supplied)
options.formatUrl {Function} Function taking (urlTemplate, start, end) and returning a URL formatted as needed by the service
options.formatDate {Function} Function to turn a date into a string formatted as needed by the service
options[...] {mixed} Other options needed by the "type" loader
Method Details
load(dataset, callback, start, currBlock)
Load data based on current time
Parameters (optional)
dataset {TimeMapDataset} Dataset to load data into
callback {Function} Callback to execute when data is loaded
start {Date} Start date to load data from
currBlock {Number} Index of the current time block
©2010 Nick Rabinowitz
Documentation generated by JsDoc Toolkit 2.3.2 on Sat Aug 06 2011 14:14:18 GMT-0700 (PDT)