General Election map

ge_swingmapWhen I first moved to UCL CASA back in 2010, the first online map I created from scratch was one showing swings in the general election that year. So it seemed fitting to update the old code with the data from the 2015 general election, which took place last week. You can see the resulting maps here – use the dropdowns to switch between headline swing, winner, second places, turnout % variations, majorities, political colour and individual party votes and X-to-Y swings.

My style of Javascript coding back in 2010 was – not great. I didn’t use JQuery or event AJAX, choosing instead to dump the results of the database query straight into the Javascript as the page was loaded in, using PHP. I was also using OpenLayers 2, which required some rather elaborate and unintuitive coding to get the colours/shapes working.Screen Shot 2015-05-11 at 15.09.08 My custom background map was also rather ugly looking. You can see what the map looked like in this old blog post. I did a partial tidyup in 2013 (rounded corners, yay!) but kept the grey background and slightly overbearing UI.

Now, in 2015, I’ve taken the chance to use the attractive HERE Maps background map, with some opacity and tinting, and tidied up the UI so it takes up much less of the screen. However, I decided to leave the code as OpenLayers 2 and not AJAX-ify the data load, as it does work pretty well “as is”. The constituency boundaries are now overlaid as a simplified GeoJSON (OL 2 doesn’t handle TopoJSON). For my time map, I was using OL 3 and TopoJSON. Ideally I would combine the two…


You might also like
2010 general election: Tory, Labour and Lib Dem talks
2010 general election: Tory, Labour and Lib Dem talks
WSRE | RALLY 2012 | General Election Oct. 25th
WSRE | RALLY 2012 | General Election Oct. 25th
General Election 2010 - Interactives and maps
General Election 2010 - Interactives and maps
Vintage 1848 Map of Map of East Bridgewater, Mass. - General map showing selected buildings and householders' names and election districts. - Relief shown by hachures. - Available also through the Library of Congress Web site as a raster image. - Includes text. - Copy imperfect: Stained, upper border cut East Bridgewater, Massachusetts, Town, United States
Home (Historic Map)
  • Vintage 1848 Map of Map of East Bridgewater, Mass. - General map showing selected buildings and householders names and election districts. - Relief shown by hachures...
  • Map size: 2 foot by 18 inches
  • Beautiful and Rare Historic Map
  • Archival Quality Reproduction
General Election Map of the UK Geoff Hoon and Paxman
General Election Map of the UK Geoff Hoon and Paxman ...
General Election Map of the UK and the swing so far.AVI
General Election Map of the UK and the swing so far.AVI
General Election Map of the UK.AVI
General Election Map of the UK.AVI
Related Posts