fjanon / timemap Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/timemap
License: MIT License
Automatically exported from code.google.com/p/timemap
License: MIT License
/*! * Timemap.js Copyright 2008 Nick Rabinowitz. * Licensed under the MIT License (see LICENSE.txt) */ Timemap.js By Nick Rabinowitz (www.nickrabinowitz.com) Timemap.js is intended to sync a SIMILE Timeline with a web-based map. Depends on: jQuery, Mapstraction 2.x, a map provider of your choice, SIMILE Timeline v1.2 - 2.3.1. Tested browsers: Firefox 3.x, Google Chrome, IE7, IE8 Tested map providers: Google v2, Google v3, OpenLayers, Bing Maps Thanks to Jörn Clausen (http://www.oe-files.de) for initial concept and code. ------------------------------------------------------------------------------- Getting Started The best way to get started depends on your learning style, but here are the places you should look: * Working Examples: ./examples/index.html * Basic Usage: http://code.google.com/p/timemap/wiki/BasicUsage * Code Documentation: ./docs/index.html * Homepage: http://code.google.com/p/timemap/ * Discussion Group: http://groups.google.com/group/timemap-development ------------------------------------------------------------------------------- Files in the project, in order of importance: Packed files (YUI Compressor) * timemap_full.pack.js: The library and all helper files. This is the recommended file to use in production. * timemap.pack.js: Just the core library file Examples (in examples/) * I recommend starting with index.html, which describes each example. Documentation * docs/ Code documentation produced by jsdoc-toolkit * examples/ Example HTML code * LICENSE.txt The MIT license * README.txt This file Supporting Libraries (in lib/) * timeline-1.2.js Packed version of Timeline v1.2 - smaller and faster than SIMILE version * timeline-2.3.0.js Packed version of Timeline v2.3.0 - *required* to use this version of Timeline, as the SIMILE version removes jQuery from the global namespace. * mxn/* Mapstraction library - fork found here: https://github.com/nrabinowitz/mxn This version is *required* for timemap.js, until my changes get pulled into the official library * jquery-1.x.x.min.js jQuery. Just for convenience - use a CDN version if you prefer * json2.pack.js JSON library - usually not required Source files (in src/) * timemap.js: The core timemap.js library * param.js Abstraction layer for parameters * state.js Functions for loading and serializing timemap state * manipulation.js: Additional functions to manipulate a timemap after loading Loaders (in src/loaders/) * flickr.js Loader for geotagged Flickr feeds * kml.js Loader for KML files * georss.js Loader for GeoRSS files * xml.js Base loader for XML files * google_spreadsheet.js Loader for the Google Spreadsheets API * json.js: Loaders for JSON (both string and jsonp) * progressive.js Loader for data loaded in chunks based on timeline location * metaweb.js Loader for Metaweb data from freebase.com Other stuff * src/ext/ A couple of extension files I didn't think were worth being in the core library * images/ Simple icons for timeline events * tests/ jsUnit tests Comments welcomed at nick (at) nickrabinowitz (dot) com.
The library is reaching a level of complexity where unit testing would be
helpful - would be helpful to have a suite of jsUnit tests to keep things
consistent.
Original issue reported on code.google.com by [email protected]
on 29 May 2008 at 6:36
There isn't any way to add arbitrary data to a KML file - it would be nice
to support basic name/value pairs in ExtendedData elements
(http://code.google.com/apis/kml/documentation/kmlreference.html#extendeddata),
just putting them into the item's "options" object.
Original issue reported on code.google.com by [email protected]
on 31 Jul 2009 at 2:11
[deleted issue]
Set up an easy way to use the same kind of remote JSON loading used by the
MetaWeb js script for an arbitrary remote JSON feed.
Original issue reported on code.google.com by [email protected]
on 14 Mar 2008 at 9:18
Rather than setting a finite number of ways the info window should open,
you should be able to specify openWindow() and closeWindow() functions in
the options object passed to loadItem. TimeMap could provide a default, and
an Ajax variation, but could open this up for other developer strategies.
Original issue reported on code.google.com by [email protected]
on 28 May 2008 at 8:46
This will allow easier tracking of issues and desired features.
Original issue reported on code.google.com by [email protected]
on 4 Mar 2008 at 7:36
1. Is it posssible to use custom markers/icons in the timeline and the map ?
2. Can I define it in the KML file ?
3. Can you provide some examples, what kind of information can be used in
KML files (how is the synthax for polygons for example)?
Thanks for your good work !
Original issue reported on code.google.com by [email protected]
on 20 Feb 2009 at 9:52
The internal loadMgr object in TimeMap.init() should be exposed as
TimeMap.loadManager, with a start() function that would reset the count,
take a new target, and accept an options object with functions, etc. This
will allow it to be used for better on-the-fly loading.
Original issue reported on code.google.com by [email protected]
on 15 Jul 2009 at 1:26
I'm having issues inserting dates that are before 1000AD, the timeline
doesn't appear to support it.
Is this a known issue?
Original issue reported on code.google.com by [email protected]
on 25 Sep 2008 at 2:05
The JavaDoc-style comments on these functions aren't consistent in
describing the JSON data format they require. Either they all need to be
consistent or only one should define the format and the others should point
to that comment for reference.
Original issue reported on code.google.com by [email protected]
on 11 Mar 2008 at 9:28
Reproduction:
1. Include prototype.js (from http://prototypejs.org) in any page using
TimeMap.
2. Fire it up.
Output:
Error: iterator.bind is not a function, in prototype.js
The problem is line 212 in timemap.js. It uses the for (x in
some_iterable) method of iterating over functions in filters.chain.
Unfortunately, since prototype works by extending base objects like, say,
Object itself), there are some extra keyed items in the array Object, like
the each method, so in addition to calling the filter methods added by
TimeMap, prototypes each function also gets called and bonks.
I've attached a very simple patch that seems to fix the problem.
Original issue reported on code.google.com by [email protected]
on 11 Jul 2008 at 3:29
Attachments:
Right now, I have loader functions, parser functions, and potentially
preload and transform functions. It would be better to consolidate these
into data service classes with a predefined interface. You could then make
services to load more specific data sources, like Google spreadsheets, as
separate classes - these classes would encapsulate the preload and
transform functions that are now separate (though presumably they could
take custom pl/t functions as well).
This would simplify the dataset syntax in TimeMap.init(), which I've never
been totally happy with, to something like this:
{
id: 'ds',
title: 'My Dataset',
theme: 'green'
type: 'kml' // service class name, or optionally a service class
options: { // all info necessary for the service
url: 'myfile.kml'
// you could potentially set preload/transform functions here,
// to override the default options; metaweb, e.g., needs transform
}
}
This avoids the awkward "data" element, and trying to choose what goes in
"data" and what goes in the core dataset object.
Then you'd create the service and load the data:
var svcClass = TimeMap.services[ds.type];
var svc = new svcClass(ds.options);
svc.load(dataset, callback);
This setup would also make it simpler to load remote data on the fly, after
initialization, and much simpler to add new services to a service library.
Original issue reported on code.google.com by [email protected]
on 28 May 2009 at 4:30
If all library interactions with the Item worked through an API (i.e. no
calls to item.placemark or item.event), then you could stick a Dataset into
the items array, expose the same API with dataset-appropriate responses,
and allow users to zoom in on a given dataset, essentially expanding the
nested items... this might be one approach to clustering/zooming events.
Original issue reported on code.google.com by [email protected]
on 8 Sep 2008 at 9:54
Right now, map placemarks not visible on the timeline are hidden on the
map. It might be nice to allow the developer to choose either a length of
time (extending both ways from the center visible date on the timeline) or
some visible overlay on the timeline for which map placemarks should be shown.
Original issue reported on code.google.com by [email protected]
on 11 Mar 2008 at 9:37
right now the onLoad function in the init script only allows scrolling to
the first or last event - it should also allow a "now" option, which will
somehow need to fire the onScrollListeners in order to display events and
hide past/future map items. It should also support an additional(?) custom
function in addition to the scrolling action (though scrolling probably
still needs to happen either way, because it's hard to sort out otherwise -
will need to think about how to support contexts in which the custom
function might override the scrollTo setting).
Original issue reported on code.google.com by [email protected]
on 21 May 2008 at 11:01
just a tweak I don't have time for right now - the API for specifying map
filters should take a string or a function, rather than specifying specific
filters as attributes.
Original issue reported on code.google.com by [email protected]
on 18 Feb 2009 at 7:10
It might make sense to hide all map placemarks when they're created,
showing them only once the timeline scrolls to its onLoad position... Would
need to think about how this might affect loading sequences in which new
items are added after the initial page load.
Original issue reported on code.google.com by [email protected]
on 30 May 2008 at 6:31
What steps will reproduce the problem?
1. Create a KML with a large data field (i.e. a LineString with many
coordinates)
2. getTagValue will only return the first 4096 characters (at least in
Firefox).
Simple change, the function (line 838) only returns
nList[0].firstChild.nodeValue
Instead you should iterate through the "nextSibling" member on
nList[0].firstChild.
verbose code shown below:
if (nList.length > 0) {
temp = nList[0].firstChild.nodeValue;
nextSib = nList[0].firstChild.nextSibling;
while(nextSib != null) {
console.log("Appended a value.")
temp += nextSib.nodeValue;
nextSib = nextSib.nextSibling;
}
return temp;
Original issue reported on code.google.com by [email protected]
on 17 Feb 2009 at 2:32
There ought to be a README file in the distro tarball, explaining the
differences between the files and pointing to the examples and the wiki for
more information.
Original issue reported on code.google.com by [email protected]
on 21 May 2008 at 5:46
Right now, TimeMap.initTimeline only overrides the event onclick event for
the first band's painter - it should check to see whether this is necessary
for other bands as well.
Original issue reported on code.google.com by [email protected]
on 5 Aug 2009 at 3:47
Fix the KML parser to support multiple geometries, instead of just stopping
as soon as one is found.
Original issue reported on code.google.com by [email protected]
on 25 May 2009 at 3:10
TimeMapDataset.hybridParser uses Timeline.DateTime.parseGregorianDateTime
to parse stuff that's not ISO 8601. The Timeline function should return
null if the string to parse is invalid, but it doesn't - it returns an
Invalid Date object, which I'm not even sure how to check for.
Should fix hybridParser, add a test, and possibly submit a fix for SIMILE.
Original issue reported on code.google.com by [email protected]
on 21 May 2009 at 4:36
You should be able to set one of the preset themes, or a theme of your own
devising, on a per-item basis.
Original issue reported on code.google.com by [email protected]
on 21 Apr 2008 at 8:55
Need to add more support for dynamic add and remove of datasets/items.
There should be clear() functions for both datasets and items that remove
events from the timeline, placemarks from the map, and items from the
items[] array.
Original issue reported on code.google.com by [email protected]
on 24 Nov 2008 at 6:38
don't think I have one of these yet.
Original issue reported on code.google.com by [email protected]
on 21 May 2008 at 11:11
What steps will reproduce the problem?
1. Extract the zip file to a folder.
2. Run the .html file
3. Choose "EAT" from Category combobox.
4. Scroll timeline to July (between 20th and 28th)
5. Events do not appear on Timeline, but they do appear correctly on Googlemap.
What is the expected output? What do you see instead?
The expected output is to see all filtered events on Timeline and on
googlemap, of course.
What version of the product are you using? On what operating system?
Timemap v1.5
Timeline v2.3.0
All browsers are affected.
Please provide any additional information below.
I tested this in FireBug. I added console.log(item.event); at
the end of filtering function. Now in FireBug, everytime I scroll the
TimeLine, I get the list of events. I picked some event that is not
visible on the timeline. And I tried to show it manually like this:
tm.timeline.getBand(0).getEventSource()._events.getEvent
('e14').item.show(); // e14 is the id of the event that is not visible
on the timeline band 0.
I also tried tm.timeline.layout(); this caused filtering to occur
again, but still items are not visible!
The weird thing is that everytime I try this filtering, events that
disappeared in the past, disappear again (exactly the same). Now if I
put "return true" at the top of my filtering function, everything
works 100% fine.
Original issue reported on code.google.com by [email protected]
on 13 Aug 2009 at 2:40
Attachments:
It seems like a zip file would work better than simply downloading the main
file. This will make it easier to package in the future, too.
Original issue reported on code.google.com by [email protected]
on 13 Mar 2008 at 4:25
too many folks are using the issue system or personal email for questions
that could be helpful to all - should create a Google Group for support.
Original issue reported on code.google.com by [email protected]
on 25 Sep 2008 at 3:19
See line 530 in timemap.js - infoPoint should be set with a {lat:x, lon:y}
object, rather than requiring a GLatLng.
Original issue reported on code.google.com by [email protected]
on 16 Oct 2008 at 3:52
Cover:
- Converting your own data (using Babel?) to a static file
- Using JSON formats from Babel, Google Calendar, Google Spreadsheets
- Using JSON from freebase
- Using KML
Original issue reported on code.google.com by [email protected]
on 16 Sep 2008 at 1:10
It might be nice to keep the timemap.js file solely for presentation stuff,
and move functions like hideDataset(), scrollTimeline(), etc. that are
meant for post-initialization control to a separate file - that way you
could just use the timemap.js file if you weren't doing anything fancy.
Original issue reported on code.google.com by [email protected]
on 22 Oct 2008 at 7:39
This is a no-brainer - otherwise there's no hook to manipulate the object
thereafter without writing your own init script.
Original issue reported on code.google.com by [email protected]
on 21 May 2008 at 11:03
When a marker is selected on the map, the corresponding event should be
highlighted in the timeline.
Possibly, the marker and timeline event should both be highlighted on
selection.
Original issue reported on code.google.com by [email protected]
on 11 Mar 2008 at 9:32
From
http://groups.google.com/group/timemap-development/browse_thread/thread/77cb0e58
e7ce4a67
I would like to be able to specify a specific date to the scrollTo
option, rather than earliest or latest. This seems like it would be
an easy change (or am I missing something?) to ifLoadedFunction to
call setCenterVisibleDate with a provided date string rather than
getEarliestDate or getLatestDate from the eventSource.
This should probably support either a date string, parsed by hybridParser,
or a date object.
Original issue reported on code.google.com by [email protected]
on 27 May 2009 at 4:22
What steps will reproduce the problem?
1. go to http://history.boisestate.edu/timemap/indexMapOnly.html
What is the expected output? What do you see instead?
should see a timemap. If you go there in ie6 or 7 the two bands are off by
12 years, the graphics are messed up and you can only scroll left so far.
What version of the product are you using? On what operating system?
happens only in ie6 or ie7. ie8, safari, firefox all work fine.
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 29 Jan 2009 at 2:59
Attachments:
User feedback indicates that a very simple demo page (perhaps one included
in the download zip file) would be helpful.
Original issue reported on code.google.com by [email protected]
on 13 Mar 2008 at 4:26
The most basic way to do this is to check if "icon" is set in the JSON
data, and use it instead of the theme icon if it is. This would pave the
way for setting icons in KML.
Original issue reported on code.google.com by [email protected]
on 13 Mar 2008 at 4:24
timemapInit() needs to test whether there are any events before scrolling
to latestDate, otherwise it'll throw an error. Could have sworn I fixed
this.
Original issue reported on code.google.com by [email protected]
on 24 Nov 2008 at 6:36
at line 439 in timemap.js, it says
if (nList.length > 0) {
data["options"]["description"] = nList[0].firstChild.nodeValue;
}
this gives an error in Safari if the file has <description></description>
Probably anything that uses this construct may need an extra check to
ensure that the tag isn't empty - perhaps move this out to a utility function?
Original issue reported on code.google.com by [email protected]
on 19 Mar 2008 at 3:17
There should be simpler management for map types in timemapInit() - you
should be able to specify the set of map types as well as the default map
type.
Original issue reported on code.google.com by [email protected]
on 22 Oct 2008 at 4:42
Two possible approaches:
- Look at clusterMarker
- Use a latlng hash approach (store events in a hash table based on their
latlng)
Original issue reported on code.google.com by [email protected]
on 14 Mar 2008 at 11:27
It would be nice if folks who started using the SIMILE Timeline XML format
could just add lat/lon to their existing data, rather than reformatting as
KML or JSON - I should add an XML parser to parse that format.
Original issue reported on code.google.com by [email protected]
on 22 May 2009 at 10:57
Upon examination, it doesn't really seem like the GPL makes sense for a
Javascript library. I'm going to move the code to a more permissive
license, either MIT or BSD.
Original issue reported on code.google.com by [email protected]
on 29 Oct 2008 at 3:57
- normally, the sequence of loading and hiding goes like this:
1. items load, creating placemarks and adding them to the map
2. once all items are loaded, the map is filtered, hiding those not visible
on the timeline
- with polygons (and probably polylines), the sequence goes like this, as
far as I can tell:
1. items load, creating polygons and adding them to the map, but drawing
them takes time
2. once all items are loaded, the map is filtered. All polygons are told to
hide(). At this point, timemap.js thinks the polygons are hidden, AND the
polygons think they're hidden, but they aren't actually visible on the map yet.
3. the polygons finish drawing are are displayed on the map. Most of them
think they're hidden, but they get drawn anyway.
The issue here is that I don't think there's any way to know when the
polygons have finished drawing. This appears to be an asynchronous
operation, but I can't see anything in the GMaps API that can tell you (by
triggering an event) when it completes. The ideal would be to wait to
filter the map until after all the polygons are drawn (a fix to
TimeMap.init()); the less-than-ideal is to catch the "drawn" event outside
of TimeMap.init() and then show all items and filter them - but this still
requires knowing when the polygons have been drawn.
Original issue reported on code.google.com by [email protected]
on 22 May 2009 at 5:16
It would be nice to have a test just for various types of KML placemarks,
to ensure that the parser avoids regression issues (and works correctly to
begin with).
Original issue reported on code.google.com by [email protected]
on 17 Feb 2009 at 8:27
Right now all items must have both a placemark and an event (i.e. both geo
data and time data), or they will be ignored on load. The system should
allow either one or the other to be missing (and maybe both? but I'm not
sure why you'd ever want that) - placemarks with no event would be
omnipresent on the map, and events with no placemark would just show up on
the timeline (and maybe open the info window in the middle of the map?).
This will require a bit of work, as the code currently assumes that both exist.
Original issue reported on code.google.com by [email protected]
on 17 Sep 2008 at 5:05
Rather than including all of the supported dataset types in the
TimeMap.init() switch statement, it should be easier to plug in new parser
types. One thought about how to do this: Store loaders in an object
attribute of TimeMapDataset, e.g.
TimeMapDataset.loaders = {
// start with basic loader
basic: TimeMapDataset.basicLoader
}
Each loader function would take an object parameter "options", including
data, dataset, preload and transform functions, and the LoadMgr object (or
just the ifLoaded function?). Then each file that defined a new parser
would also define the loader, adding it to the TMD.loaders object.
So instead of the switch statement, we'd just have
loader = TimeMapDataset.loaders[data.type];
loader(options);
This would decouple the loader logic from the init function, making it
easier to add new loaders.
Original issue reported on code.google.com by [email protected]
on 22 May 2009 at 11:14
If there is no <end> data in a TimeSpan node in the KML file being
processed, make it default to the current date.
Original issue reported on code.google.com by [email protected]
on 5 Mar 2008 at 5:17
Cover:
- CSS styling
- Dataset themes
- SIMILE styling
Original issue reported on code.google.com by [email protected]
on 16 Sep 2008 at 1:11
The library should provide functions to parse GeoRSS in the same way it
parses KML.
Original issue reported on code.google.com by [email protected]
on 11 Mar 2008 at 10:12
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.