Wikipedia overlay

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 and you’ll be redirected to a page about bananas in the language configured in your browser. in turn will send you to the Spanish page about bananas, i.e.×_paradisiaca


4 Responses to “Wikipedia overlay”

  1. Link Mauve Says:

    Wow, this map is really great!
    But can you use the localized wikipedia tag (wikipedia:fr for the French Wikipedia) if there is no English wikipedia tag? I have mapped many cities that only have localized Wikipedia pages, and it’ll be very useful to show links to them.
    Thanks a lot!

  2. balrog Says:

    the page already uses wikipedia:[lang]= as well as wikiepdia=[lang]: tags. The former form is displayed in grey and the latter blue (because I prefer that form).

    Please check that it works, if it doesn’t work then I need to fix something :)

  3. Cue Cumber Says:

    Wow, this map is very good! You should start a bigger project or contribute that to a existing map!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: