More fun with APIs

22 August 2006

After playing with the Timeline API last week, and having reasonable success, I thought I’d try another widget this week.

As a result, AotW now has another new feature: a Gazetteer for the Maryland Campaign of 1862. Please go try it and let me know what you think.

AOtW screenshot of Gazetteer map
AotW Gazetteer screenshot

My gazetteer is an index of towns, structures, and geographic features–about 70 places so far–most often mentioned in the literature of the Campaign. Some are archaic names not found on modern maps, some are just hard to find. All are listed as links below a lovely GoogleMap.

Click a name on the list and we plot and center the location on the map.

I don’t intended this map to supplant the campaign or battle maps already on AotW. But I expect this would be a useful tool for someone trying to follow the action reading a book or other document on the campaign. Or someone planning a trip to the area, and plotting places to see. Or looking at the relationships between two or more points of interest.

Each location is (or will eventually be) tagged with additional information and links to associated events or people. This information is presented as a pop-up window on demand.

The map behaves in the ways you’d expect of a Google Map, so I hope it will be easy, even intuitive, to use.

I have been accumulating geo-data for towns and features in the AotW database for some time now, not knowing exactly how to use it. With the Google Maps API it was a fairly simple leap to put these places on a map. I’d like eventually to make more sophisticated use of both the data and the mapping API, but for now I’m happy with this fairly specific function.

__________________________

Techno-comments

  • The Google Maps API is well documented and supports/is supported by a huge community of developers and other users. There’s plenty of help out there.
  • I was up most of last Sunday night making all this work. Went round and round and round … the final code looks trivial to me now, but it wasn’t automatic.
  • Like Perl, there are many ways to code something in Javascript. It turns out, also, that some of the Google calls I needed are “undocumented” and others did not work as I thought they should. Being open to trial-and-error and cribbinglearning from what others have done were key for me here.
  • I’m not blaming Google or Javascript for my difficulties, per se. I hate Javascript, but it’s me, not it. Google is doing great things in this arena – my thanks to them.
  • I used PHP code to pull the locations and geo-data from the database and write the Javascript used to invoke the API and its functions. I pass data between the html and the map on the link URLs. A little fat, perhaps, but effective. I tried several other methods. Too hard.
  • If you view-source on my Javascript, please comment by private email and save me the public embarrassment, won’t you?

I’m reminded to opine by an article in yesterday’s Washington Post which looks at Google’s program to digitize millions of books. There’s been a lot of excitement about this; many people adamantly pro or con.

As a digital historian I’m all for it.

I do the bulk of my initial research on line, followed by work in books, collections, and archives I find from online references. I find both sources and pointers to sources online. A vast collection of books searchable by browser sounds like Nirvana to me.

Beyond simple reference, I can only faintly imagine the amazing things that could be done with this new corpus literae googlius (apologies to Dr Turkel).

Google would/will make money doing this, of course. Perhaps they’re the Devil.

New Timeline for AotW

7 August 2006

A couple of weeks ago, one of my favorite Internet-friends, Andrew Vande Moere*, mentioned the Simile Timeline API in a post on his information aesthetics blog. Timeline is described by its creators as …

… a DHTML-based AJAXy widget for visualizing time-based events. It is like Google Maps for time-based information … Pan the timeline by dragging it horizontally … like Google Maps, you can populate Timeline with data by pointing it to an XML file …

This weekend I finally had a little time to see what it can do, and found it’s great fun.

It is one of those rare, beautiful little software gems with a clear purpose and excellent execution.

The documentation is crap–beyond the basic installation–but that’s just a quibble. Perhaps I can help improve the docs later. It’s also a bit slow in loading events and misbehaves sometimes in IE. Another quibble. For now, I’ll have fun discovering all the controls and features by dint of ‘reverse engineering’ or trial and error. And I prefer Firefox anyway.

So, perhaps obviously, I’ve made use of this fine tool for a new Campaign Timeline on AotW. Give it a spin, won’t you, and provide some constructive criticism? I think it has huge potential.

screen shot: timeline
AotW timeline screenshot

I’ve seeded my timeline with content from the 200-odd battlefield historical tablets. I used those events because I’d already transcribed them in the database, and had serendipitously included time stamps for each as I did the data entry. The timeline application reads events from an xml file, so it wasn’t too difficult to write some php code to extract and write the xml from a tailored Events table in my database.

Now, un/fortunately, I can hear hundreds of other 1862 events calling out to me.

Add me! Add me!

Yet another hungry project mouth to feed.
_________________

* Vande Moere finds people using the most incredibly creative and useful ways to display information and pops them up on his blog. As a closet Tuftean, I’m a big fan. Usually, however cool, I can see no good way to use these amazing techniques. Until now. Thank you Andrew.

In Googling keywords mit, simile, and timeline, looking for other people using the Timeline API (hoping for clues to customizing it) I found about 200 unique references. Only about 10 of these are actual users. Everybody else is just talking about how cool it is. I wonder when/if web timelines built on this will be common?