Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
createDataset - Map Markers but no Timeline Events
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
David Fisher  
View profile  
 More options Jun 8 2012, 9:13 am
From: David Fisher <fallencli...@gmail.com>
Date: Fri, 8 Jun 2012 06:13:47 -0700 (PDT)
Local: Fri, Jun 8 2012 9:13 am
Subject: createDataset - Map Markers but no Timeline Events

Hi,
When using the following code i get the markers on the map from the newly
created dataset but no timeline events when scrolling the timeline:

var scheduleMode = 0,
tm = TimeMap.init({
        mapId: "map",               // Id of map div element (required)
        timelineId: "timeline",     // Id of timeline div element (required)
        options: {
            mapType: "road"
        },

        datasets: [
        {
            id: "events",
            title: "events",
            type: "basic",
            options:{
                items: appDatasetItems
            }
        }
        ],
        bandIntervals: [
        Timeline.DateTime.HOUR,

        ]
    });
var newEventDatasetItems = [];
var eventRecords = $.map(newEventData, function(item){
var newEventDatasetItem = {
                "start":item.Start,
                "end":item.End,
                "point":{
                    "lat":item.Lat,
                    "lon":item.Long
                },
                "title":item.HoldingName,
                "options":{
                    description:item.HoldingName,
                    icon: appImageUrl + item.MapIcon,
                    eventColor: item.Colour,
                    eventIconImage: item.MapIcon,
                    Status:item.Status,
                    iconSize: [32,45]
                }
            };

});

tm.timeline._bands[0].addOnScrollListener(function(a){
        if(scheduleMode === 0){
            scheduleMode = 1;
            tm.datasets.events.hide();
            var newEventDataset =
tm.createDataset("newevents",{id:"newevents",title:"newevents",type:"basic" });
            newEventDataset.loadItems(newEventDatasetItems);
            tm.refreshTimeline(); // Also tried tm.timelline.layout()
            return console.log(tm);
        }
    });
Any help in the right direction appreciated thanks.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nick Rabinowitz  
View profile  
 More options Jun 13 2012, 12:18 pm
From: Nick Rabinowitz <n...@nickrabinowitz.com>
Date: Wed, 13 Jun 2012 09:18:20 -0700
Local: Wed, Jun 13 2012 12:18 pm
Subject: Re: [timemap-development] createDataset - Map Markers but no Timeline Events

Hi David -

I'm not totally sure what you're trying to do here. Notes below:

var scheduleMode = 0,

I assume up to here is just setup, and the rest of the code is actually
being run asynchronously, right? Otherwise you'd just be adding all items
at load time.

Shouldn't you be returning newEventDatasetItem from the $.map function?
Otherwise the resulting eventRecords array will be empty...

> tm.timeline._bands[0].addOnScrollListener(function(a){
>         if(scheduleMode === 0){
>             scheduleMode = 1;
>             tm.datasets.events.hide();
>             var newEventDataset =
> tm.createDataset("newevents",{id:"newevents",title:"newevents",type:"basic" });
>             newEventDataset.loadItems(newEventDatasetItems);
>             tm.refreshTimeline(); // Also tried tm.timelline.layout()
>             return console.log(tm);
>         }
>     });

I'm not sure this is the best way to do this, but it's hard to tell without
a better understanding of what you're trying to do. In any case, the main
issue here is that your dataset doesn't have an eventSource tied to the
timeline - that's the data structure the timeline uses to hold events, and
you need to get a reference to the eventSource for the band where you want
the events to appear, or the timeline won't know about them. In most cases
(unless you're showing different events on different bands), there's only
one eventSource per TimeMap object, and there's an easy reference to it:

var newEventDataset = ...
newEventDataset.eventSource = tm.eventSource;
// etc

and that should probably do it. Let me know if that works -

-Nick


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
matt.koe...@gmail.com  
View profile  
 More options Dec 21 2012, 2:14 pm
From: matt.koe...@gmail.com
Date: Fri, 21 Dec 2012 11:14:35 -0800 (PST)
Local: Fri, Dec 21 2012 2:14 pm
Subject: Re: createDataset - Map Markers but no Timeline Events

Hi,

I have the same issue but I think I know what the problem is.  I just don't
know how to fix it.

1) I'm using the kenya.html along with the kenya.kml
 The kml format of a placemark is as follows:

    <Placemark>
        <name>Vredefort</name>
        <TimeStamp><when>2000-10-01</when></TimeStamp>
        <ExtendedData>
          <Data name="Country">
            <value>South Africa</value>
          </Data>
          <Data name="Diameter">
            <value>300km (~186.4 mile)</value>
          </Data>
          <Data name="Age">
            <value>2023 &#177; 4 Million years</value>
          </Data>
          <Data name="Url">
            <value>http://en.wikipedia.org/wiki/Vredefort_crater</value>
          </Data>
        </ExtendedData>
        <Point>
            <coordinates>27.5,-27,0</coordinates>
        </Point>
    </Placemark>

2) For my own project, I published a KML through GeoMedia and opened it in
Google Maps with no issues.
    However, this is the kml format of my placemark:

<Placemark>
<name>Unknown</name>
<styleUrl>#Style1</styleUrl>
<ExtendedData>
<SchemaData schemaUrl="#Schema1">
<SimpleData name="InterruptionDate">2009-01-03T00:00:00</SimpleData>
<SimpleData name="SubCause">Unknown</SimpleData>
</SchemaData>
</ExtendedData>
<Point>
<coordinates>-81.2861270482308,42.9392106072815,0</coordinates>
</Point>
</Placemark>

Question - How do get my format corrected without manually editing every
placemark.  I'm assuming <TimeStamp><when>2000-10-01</when></TimeStamp>
is the key for the timeline.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nick Rabinowitz  
View profile  
 More options Dec 22 2012, 9:27 am
From: Nick Rabinowitz <n...@nickrabinowitz.com>
Date: Sat, 22 Dec 2012 06:27:19 -0800
Local: Sat, Dec 22 2012 9:27 am
Subject: Re: [timemap-development] Re: createDataset - Map Markers but no Timeline Events

Timemap.js has some ExtendedData support, and there's a hook for mapping
your tags to the names Timemap expects. So I think you can do something
like this:

datasets: [
    {
        type: "kml",
        options: {
            url: "your_data.kml", // KML file to load
            // array of ExtendedData elements to look for
            extendedData: ["InterruptionDate"],
            tagMap: {
                "InterruptionDate":"start"
            }
        }
    }
]

The only issue here is that I'm not sure that Timemap.js can handle the
SchemaData / SimpleData form of ExtendedData - it just uses the untyped
Data elements, as far as I can see.

If this doesn't work, there are a few options:

- You might be able to do this with the extraTags parameter. Timemap uses
jQuery for the lookup, so I think you could use a complex selector for
this, e.g.

datasets: [
    {
        type: "kml",
        options: {
            url: "your_data.kml", // KML file to load
            // array of ExtendedData elements to look for
            extraTags: ["SimpleData[name='InterruptionDate']"],
            tagMap: {
                "SimpleData[name='InterruptionDate']":"start"
            }
        }
    }
]

This might take some trial and error to get the mapping right.

- You could override TimeMap.params.ExtendedDataParam (see
https://code.google.com/p/timemap/source/browse/trunk/src/loaders/kml...)
- redefine this in your own code to look for SimpleData elements.

I hope that helps -

-Nick


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »