okfn/openspendingjs — Issue #6: Integrate Maps into Explorer
Author: gka
Created: 2012-01-21 23:46:00+00:00
State: open

I think it's about time for us to integrate maps into OpenSpending. Some datasets already have a geographic dimension, like [ukgov-finances-cra](http://openspending.org/ukgov-finances-cra) has the dimension [region](http://openspending.org/ukgov-finances-cra?_view=region). Now the explorer need to know just two things: does this dataset have a geographic dimension and is there a map prepared for it. We could even reduce this check to a simple check for existing files:

Let's say we have a folder `maps/`somewhere. For the uk example we would create a folder `maps/ukgov-finances-cra/` and put a map source inside, named after the region dimension: `region.svg`. For datasets with more geographical dimensions, like [eu-commission-fts](http://openspending.org/eu-commission-fts) which has dims for three nuts region levels, we could place different maps into that folder.

On the frontend side we would eventually display a link **show map** to link to the map view. At the map view, a dropdown would allow the users to select the geographic dimension if more maps are available.

The creation of the map sources would become a manual integration step. Although I'm already working on a [tool](https://github.com/kartograph/kartograph.py/wiki/API) to create svg maps, there's always the risk of mismatching regions. However, in many scenarios this integration is a rather simple task.

For the rendering side, I've written a JS library that renders the svg maps, too. It comes with support for some basic datavis features, like showing maps with bubbles or pie charts on it or coloring regions. OpenSpending would be a perfect use case for this lib.

What do you think?