January 26, 2008

Displaying Google Calendar Events on a Map

If you use Google Calendar, you'll probably know that you can add a location for every calendar event; you may even know that you can then click through to that location on a Google map (see the map link?):


Last night, I was having a little tinker putting together a calendar of the public consultation events regarding the Isle of Wight council proposals for the future of school education on the Island. Using a Google Calendar makes it easy to embed the calendar on an any web page, which means the calendar becomes a reusable resource for other people, if they want to display such a calendar.

From the Calendar settings:


you can grab some embed code for the calendar:


which can then be pasted in your own web pages (feed readers, click thru to see the embedding on the original page...):

The above calendar is actually being pulled in to the page live from Google Calendar. You can add the calendar to your own Google calendar by clicking the "+ Google calendar" button.

The calendar can also be found here: IW Schools Reorganisation Counsulation Evenings

Also in the Calendar settings are some links to various output feeds from the calendar (if you have set the sharing permissions appropriately - calendars can be publi, private, or shared with certain people):


The XML feed is essentially an RSS feed. Now I happen to know that if you paste a geoRSS feed in to a Google Maps search box, and hit search, the map will plot the geo-marked up locations.

A geoRSS feed is one that contains location information (latitude and longitude co-ordinates, typically), so I assumed that the Google Calendar feed would support geoRSS and encode the locations of the events listed in the calendar. After all, the map link suggests Google knows how to do this!;-)

So I posted the XML feed link into Google maps - and no joy: no geotags :-(

Enter Yahoo Pipes - and a 30s pipe to geocode a Google calendar feed:


Running the pipe actually displays the events on a Yahoo map, but you can also get hold of a KML feed URL:


KML is like RSS on steroids for syndicating geographical related data. You can use it to display pointers in Google Earth, for example, and also paste it into a Google maps search box (then hit "search Maps"), and maybe grab the embed code for the Google map, displaying the calendar events, via a Yahoo pipe):


Here's the map of IOW schools reorganisation consultation evenings, pulling the feed in live from Google calendar via a Yahoo pipe, and then plotting the location of each event on the embedded, interactive map (click on one of the balloons to see... feed readers, you'll need to click thru...):

View Larger Map

So there you have it - a quick mashup to display Google Calendar events in an embedded calendar, or on an embedded map.

PS it's maybe worth noting that this post took me maybe half and hour to put together (with interruptions). Building the mashup took less than 5 mins, partly because I knew what sorts of mashup opportunity Yahoo pipes, and Google Calendars and maps offer. The app as described above is completely disposable - it took so little time to put together it doesn't really matter if no-one ever makes use of it. But if they want to, they can.
Writing this up as an academic conference paper, on 'using Google tools to support participatory democracy', or something similarly worthy sounding, would take maybe half a day and no-one would read it... go figure...

PPS the call to the Yahoo pipe sometimes times out in the map. To guarantee the map displaying the KML feed, you could always save the KML feed as a KML file, then upload it somewhere and use that URL in the Google Map search box...

PPPS see how I used Google MyMaps to display each of the three school closure options: Mapping Proposed School Closure Plans on the Isle of Wight

del.icio.us user? Tags all over the place? Check out this delicious stemming pipe hack

Twitter user? Try this: Geo Twitter - GeoCoding Your Tweets and Plotting Them on an Embeddable Map

PS I've put together a little script that simplifies usage by taking a Google Calendar ID and then automatically plotting a Map and calendar side by side.

PPS here's a Google calendar events map embed code generator - give it a gCal id and get an iframe containing a map view of the events in return...

Blogged with Flock

Tags: , , , , , ,

Posted by ajh59 at January 26, 2008 08:23 PM

"Writing this up as an academic conference paper, on 'using Google tools to support participatory democracy', or something similarly worthy sounding, would take maybe half a day and no-one would read it..."

... but it would get you a lot more academic kudos and credit than a blog post.

"go figure..."

Indeed. :-)

Posted by: Doug Clow at January 28, 2008 04:52 PM


Awesome work on this! My organization was looking for something that did just this!!

I do have a question though.. we have multiple google calendars which hold different information which we would like to have combined on a single map. Could the pipe be tweaked so i could input say 10 different xml feeds into one pipe?

Any help is greatly appreciated!


Posted by: Gitesh Gohel at March 6, 2008 07:53 PM