Riding Google Maps come to the Pundits' Guide
Selecting that menu item brings up a fully interactive Google Map of the riding, colour-coded to the party which last won that seat. The menu item is titled "Google MapS", because I expect (one day, hopefully soon) to be adding other maps to it, such as maps showing earlier elections and maps showing poll-by-poll results. That's where all the action will be, in other words.
I also think this map can be improved by adding neighbouring riding boundaries, etc., etc. If you have other ideas to improve it, or encounter any difficulties otherwise, please leave a comment below.
For the technical readers among you, the full URL to link to a riding profile page showing the map appends a "pane=3" parameter to the query string (financial metrics are pane=1, census data is pane=2). So, for example, here is the URL that brings up the map for New Brunswick Southwest:
http://www.punditsguide.ca/riding_e.php?riding=976&pane=3
As always, you can generate the correct URL for linking to by using the "Permalink" feature at the top right-hand corner of any database-generated (i.e., non-blogpost) page.
For the really technical readers among you, I'm using the Google Maps API v.2 and feeding it with a GGeoXml object which is populated by a PHP script that dynamically returns KML generated on the fly out of my database. Setting up this whole technical infrastructure is what's taken some time. The poll-by-poll version is still in the works.
Of course, this feature would not be possible without the commitment of the Geography Division at Elections Canada to make their data available publicly and for free, and I hope you'll join me in thanking them for that undertaking.
Anyway, this website has needed maps for a good long while, so I'm very happy everything could finally get pulled together. Stay tuned for more developments ... and if you really want to see more of them, you can always invite my beau golfing for another week or so down south ... I'll miss him terribly, of course, but will just get a whole lot more done that way. Welcome home, dear!
Labels: Google Maps, Open Government Data




