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



4 Comments:
I must once against compliment you on your site. You have the double talent of both being a data webapp-wonk, and (just as important!) an intuitive user interface developer (the latter of which seems to be sadly missing on a lot of sites, including mine).
Wow, Sacha, you've completely made my day; thank you.
High praise indeed given the source!
Guess I'll just have to keep it up, then.
i'm going to add that i also liked the maps but for the rural ridings they maybe lacked details although they give a good general view of the riding they lacked some of the small communities and municipalities located in the ridings . but if your unfamilar with a specific riding the map gives a good view and at least a general idea of what territory the riding covers . the urban riding maps provided much more detail i though and were better as they included streets and such .
Anon, you may have missed the fact that, being Google Maps, they are fully interactive just like the maps you look up at the Google Maps website.
This means that, for the rural ridings, you can use the + sign in the zoom control in the top left-hand corner to zoom in. You can also click and hold your mouse down to drag a map one way or the other, again just like the Google Maps you're used to.
Give it another try and let me know if it's working for you. It's made me think that I should put a bit of text on top of the map to let users know they can click, zoom and drag just like they're used to doing on the Google site.
Thanks for taking the time to leave your comment.
Post a Comment
Links to this post:
Create a Link
<< Home