Skip to content

Instantly share code, notes, and snippets.

@mojowen
Last active November 7, 2016 05:11
Show Gist options
  • Save mojowen/0fcf1c408f4fb2f1c9ea2e5d8936c80f to your computer and use it in GitHub Desktop.
Save mojowen/0fcf1c408f4fb2f1c9ea2e5d8936c80f to your computer and use it in GitHub Desktop.
Fullpage JustVote
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=true&libraries=geometry"></script>
<script src="http://justvotecolorado.org/justvote/js/electionMap.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<script type="text/javascript">
ElectionMap.prototype.config = {"types":{"drop off":{"long_title":"drop off","icon":"http://chart.apis.google.com\/chart?chst=d_map_pin_letter&chld=|00bdef"},"vote center":{"long_title":"vote center","icon":"http://chart.apis.google.com\/chart?chst=d_map_pin_letter&chld=|ff4429","default":"true"}},"states":["on","on"],"url":"https:\/\/spreadsheets.google.com\/feeds\/list\/1jCTNodsee2a36JrZaQ-QY0t4VN24cwP3VFi3gG77ixA\/ovnuykr\/public\/values"}
</script>
</head>
<body>
<div id="canvas" style="position: absolute; top: 0; right: 0; left: 0; bottom: 0;"></div>
<form id="geocode" style="position: absolute; top: 0; z-index: 4;">
<select id="location_type">
<option value="">Select your destination</option>
<option value="vote center">Voter Service and Polling Center</option>
<option value="drop off">Ballot Drop Off</option>
<option value="all">Both</option>
</select>
<select id="county">
<option value="">Select your county</option>
<option value='adams'>Adams</option>
<option value='alamosa'>Alamosa</option>
<option value='arapahoe'>Arapahoe</option>
<option value='archuleta'>Archuleta</option>
<option value='baca'>Baca</option>
<option value='bent'>Bent</option>
<option value='boulder'>Boulder</option>
<option value='broomfield'>Broomfield</option>
<option value='chaffee'>Chaffee</option>
<option value='cheyenne'>Cheyenne</option>
<option value='clear creek'>Clear Creek</option>
<option value='conejos'>Conejos</option>
<option value='costilla'>Costilla</option>
<option value='crowley'>Crowley</option>
<option value='custer'>Custer</option>
<option value='delta'>Delta</option>
<option value='denver'>Denver</option>
<option value='dolores'>Dolores</option>
<option value='douglas'>Douglas</option>
<option value='eagle'>Eagle</option>
<option value='el paso'>El Paso</option>
<option value='elbert'>Elbert</option>
<option value='fremont'>Fremont</option>
<option value='garfield'>Garfield</option>
<option value='gilpin'>Gilpin</option>
<option value='grand'>Grand</option>
<option value='gunnison'>Gunnison</option>
<option value='hinsdale'>Hinsdale</option>
<option value='huerfano'>Huerfano</option>
<option value='jackson'>Jackson</option>
<option value='jefferson'>Jefferson</option>
<option value='kiowa'>Kiowa</option>
<option value='kit carson'>Kit Carson</option>
<option value='la plata'>La Plata</option>
<option value='lake'>Lake County</option>
<option value='larimer'>Larimer</option>
<option value='las animas'>Las Animas</option>
<option value='lincoln'>Lincoln</option>
<option value='logan'>Logan</option>
<option value='mesa'>Mesa</option>
<option value='mineral'>Mineral</option>
<option value='moffat'>Moffat</option>
<option value='montezuma'>Montezuma</option>
<option value='montrose'>Montrose</option>
<option value='morgan'>Morgan</option>
<option value='otero'>Otero</option>
<option value='ouray'>Ouray</option>
<option value='park'>Park</option>
<option value='phillips'>Phillips</option>
<option value='pitkin'>Pitkin</option>
<option value='prowers'>Prowers</option>
<option value='pueblo'>Pueblo</option>
<option value='rio blanco'>Rio Blanco</option>
<option value='rio grande'>Rio Grande</option>
<option value='routt'>Routt</option>
<option value='saguache'>Saguache</option>
<option value='san juan'>San Juan</option>
<option value='san miguel'>San Miguel</option>
<option value='sedgwick'>Sedgwick</option>
<option value='summit'>Summit</option>
<option value='teller'>Teller</option>
<option value='washington'>Washington</option>
<option value='weld'>Weld</option>
<option value='yuma'>Yuma</option>
</select>
</form>
<script>
var _gaq = _gaq || []
$(document).ready( function() {
var election_map = new ElectionMap(window.map, { type: 'all' })
$('select#county').change( function() {
election_map.county_zoom( $(this).val() );
})
$('#location_type').change(function() {
election_map.set_type = $(this).val()
election_map.render_map()
})
})
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment