Archive for the ‘Wikipedia’ Category

Wikipedia overlay

October 6, 2009

Last week I’ve set up an overlay for OSM that displays Wikipedia links completely obstructing the view of the map.  I explained it in more detail in this mailing list posting, but other people have blogged about it so I probably should too.

It’s not like the Google wikipedia layer because it display links from OpenStreetMap entities to Wikipedia, not the other way.  At the low zoom levels you’ll only see dots but if you zoom in to an interesting place there will be roads, rivers, polygon areas etc all linking to respective Wikipedia pages.  Only Firefox is supported because I’m not using OpenLayers (but some WebKit-based browsers seem to work some of the times, and a commercial browser starting with O).

The goal of this is to get more people using the wikipedia= tag in OSM — if you’ve been making applications with OpenStreetMap data you’ve surely noticed that people much more often map features that get visualised somewhere in some way.  It’s also an experiment in a couple of directions: it’s a tiled GeoJSON layer (as opposed to bitmap tiles) — this gets us browser caching and seems to be much faster than an area query like OpenStreetBrowser uses.  The tiles can be retrieved using JSON-P in addition to xhr, I also have added a kind of “kinetic” zoom — the base map widget is based on Bernhard Zwischenbrugger’s excellent zoom zoom zoom map in place of OpenLayers, meaning it’s also 20 times smaller in terms of lines of code.  Also zoom beyond mapnik tile levels is supported, this may be good accessibility wise even though it’s a bad workaround for the default mapnik style rendering names in a pretty small font.

I’ve also set up a http redirect for wikipedia interwiki links and images that saves you one click, it’s fully described at the OSM forums but in short, if you only know the german title of a wikipedia page referring to something, you can type http://wp.openstreetmap.pl/de:Bananen and you’ll be redirected to a page about bananas in the language configured in your browser.  http://es.wp.openstreetmap.pl/de:Bananen in turn will send you to the Spanish page about bananas, i.e. http://es.wikipedia.org/wiki/Musa_×_paradisiaca