Sunday, May 07, 2006

Geoblog

Today I played a bit with geotagging blog posts. This basically means indicating where the post was made, using longitude and latitude. The result of this can be seen on the blog in the form of links to Google Maps below the blog posts that I've tagged.

The more technically inclined may be interested in how this is done. I took a very simple approach, since Blogger doesn't support tagging. To tag a post with a geo location I include the string "lat:latitude,lon:longitude" somewhere in the body. When viewing the blog, these strings are replaced with links to Google Maps using Javascript. When fetching the Atom feed, the string is however included. This allowed me to create a Geoblog, which instead of showing the posts in a list, one after another, shows the posts on a map. The geoblog just grabs the feed, parses the posts to see which have been geotagged, and puts these on a map. Simple, but pretty cool stuff...

No comments: