Progressive loader

70 views
Skip to first unread message

Nick Rabinowitz

unread,
Nov 7, 2009, 8:22:14 PM11/7/09
to Timemap.js Development
Hello all -

This has come up a couple of times on the list, so I wanted to note that I've added a new loader for progressive loading (i.e. loading blocks of data based on the position of the timeline), now in the SVN trunk. It's basically a wrapper for other remote loaders, so it can use any existing type of loader (jsonp, json_string, kml, etc), as long as you have either a service that can take a start and end date (e.g. /mydata.json?start=2009-11-05&end=2009-11-07) or static files covering regular time intervals (e.g. data2009-11-05.json, data2009-11-06.json, etc). Basic syntax within TimeMap.init() looks like this:

  datasets: [
        {
            title: "Progressive JSONP Dataset",
            type: "progressive",
            options: {
                // the loader type you really want
                type: "jsonp",
                // options for the loader you want, including a URL with placeholder strings
            }
        }
    ]

I added an example page at http://timemap.googlecode.com/svn/trunk/examples/progressive.html , which progressively loads data from a random data generation service.

I hope this is useful - enjoy!

-Nick

chao

unread,
Aug 6, 2012, 5:06:27 PM8/6/12
to timemap-d...@googlegroups.com
Hi Nick,

Could you give an example that for 
static files covering regular time intervals (e.g. data2009-11-05.json, data2009-11-06.json, etc)
for example i store all my data in a folder called data

the format will be :

 datasets: [
        {
            title: "Progressive JSON Dataset",
            type: "progressive",
            options: {
                // the loader type you really want
                type: "json_",
                // options for the loader you want, including a URL with placeholder strings
                url: "/data" //? not sue
            }
        }
    ]

Chao Liu

unread,
Aug 8, 2012, 6:04:08 PM8/8/12
to timemap-d...@googlegroups.com
Hi Nick,
Thank you for your reply and I still have a small confuse:
datasets: [
        {
            title: "Progressive JSONP Dataset",
            type: "progressive",
            options: {
                // the loader type you really want
                type: "jsonp",
                // options for the loader you want, including a URL with placeholder strings
            }
        }
    ]
I am test my code under chrome, and for some security reason,chrome doesn't allow to load files locally, so I want to know whether it's possible to load the local file?

something not like url: "http://www.test.com/getsomejson.php?start=[start]&end=[end]callback=
but url:"/mydata.json?start=[start]&end=[end]"

And what doese "static files covering regular time intervals (e.g. data2009-11-05.json, data2009-11-06.json, etc)." mean?
 I do have my data ordered by date: 2012-08-01.json,2012-08-02.json,2012-08-03.json... 
and how can I input the files?

so the question become how could I input a bunch of files with json format and each with date as file name into timemap?

the syntax will be?
datasets: [
        {
            title: "Progressive JSON Dataset",
            type: "progressive",
            options: {
                // the loader type you really want
                type: "json_",
                // options for the loader you want, including a URL with placeholder strings
                url: "/mydatafolder?" 
            }
        }
    ]





On Mon, Aug 6, 2012 at 2:06 PM, chao <chao...@adaramedia.com> wrote:
Hi Nick,

Could you give an example that for 
static files covering regular time intervals (e.g. data2009-11-05.json, data2009-11-06.json, etc)
for example i store all my data in a folder called data

the format will be :

 datasets: [
        {
            title: "Progressive JSON Dataset",
            type: "progressive",
            options: {
                // the loader type you really want
                type: "json_string",
                url: "/data?start=[start]&end=[end]" // this is the part I am not sure
            }
        }
    ]

 and for the json files, is that each one should have a start time? for example in file 2012-08-01.json

[
 { "title:":"point",
    "start": "2012-08-01",
    "point":{
      "lat": 1.342,
      "lon": 23.425
     },
{...},
{...},
{...},
{...}
]

Thank you so much. And the timemap project is really great! go bears!

 


On Saturday, November 7, 2009 5:22:14 PM UTC-8, Nick R wrote:
Hello all -

This has come up a couple of times on the list, so I wanted to note that I've added a new loader for progressive loading (i.e. loading blocks of data based on the position of the timeline), now in the SVN trunk. It's basically a wrapper for other remote loaders, so it can use any existing type of loader (jsonp, json_string, kml, etc), as long as you have either a service that can take a start and end date (e.g. /mydata.json?start=2009-11-05&end=2009-11-07) or static files covering regular time intervals (e.g. data2009-11-05.json, data2009-11-06.json, etc). Basic syntax within TimeMap.init() looks like this:

  datasets: [
        {
            title: "Progressive JSONP Dataset",
            type: "progressive",
            options: {
                // the loader type you really want
                type: "jsonp",
                // options for the loader you want, including a URL with placeholder strings
            }
        }
    ]

I added an example page at http://timemap.googlecode.com/svn/trunk/examples/progressive.html , which progressively loads data from a random data generation service.

I hope this is useful - enjoy!

-Nick

--
You received this message because you are subscribed to the Google Groups "Timemap.js Development" group.
To view this discussion on the web visit https://groups.google.com/d/msg/timemap-development/-/Zi9DPR4aIl0J.
To post to this group, send email to timemap-d...@googlegroups.com.
To unsubscribe from this group, send email to timemap-develop...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/timemap-development?hl=en.

Reply all
Reply to author
Forward
0 new messages