diff --git a/app/scripts/app.js b/app/scripts/app.js index 341d025..a4511b3 100644 --- a/app/scripts/app.js +++ b/app/scripts/app.js @@ -8,7 +8,6 @@ require.config({ bootstrapCarousel: '../bower_components/bootstrap-sass/assets/javascripts/bootstrap/carousel', bootstrapCollapse: '../bower_components/bootstrap-sass/assets/javascripts/bootstrap/collapse', bootstrapDropdown: '../bower_components/bootstrap-sass/assets/javascripts/bootstrap/dropdown', - bootstrapModal: '../bower_components/bootstrap-sass/assets/javascripts/bootstrap/modal', bootstrapPopover: '../bower_components/bootstrap-sass/assets/javascripts/bootstrap/popover', bootstrapScrollspy: '../bower_components/bootstrap-sass/assets/javascripts/bootstrap/scrollspy', bootstrapTab: '../bower_components/bootstrap-sass/assets/javascripts/bootstrap/tab', @@ -39,9 +38,6 @@ require.config({ bootstrapDropdown: { deps: ['jquery'] }, - bootstrapModal: { - deps: ['jquery', 'bootstrapTransition'] - }, bootstrapPopover: { deps: ['jquery', 'bootstrapTooltip'] }, @@ -187,7 +183,6 @@ require(['jquery', var link = $('').text(result.formatted_address).data('location', result.geometry.location).on('click', addressClickHandler); $('
  • ').append(link).appendTo($ul); } - $('.modal').modal('hide'); } } @@ -206,9 +201,9 @@ require(['jquery', zipCode = zipCodeComponent && zipCodeComponent.short_name; var isInCambridge = ($.inArray(zipCode, ['02138', '02139', '02140', '02141', '02142', '02238'])) > -1, - isStreetAddress = ($.inArray('street_address', address.types)) > -1; + isNotPO = ($.inArray('post_box', address.types)) == -1; - return isInCambridge && isStreetAddress; + return isInCambridge && isNotPO; } geocoder.geocode({ @@ -221,7 +216,6 @@ require(['jquery', // if there are multiple results, look for Cambridge-specific street results results = $.grep(results, addressIsCambridgeStreetAddress); - // if there are no results, try searching for Cambridge if (!results.length) { geocoder.geocode({ address: address + ' Cambridge, MA' }, function(results, status) { diff --git a/app/scripts/early_voting_mgr.js b/app/scripts/early_voting_mgr.js index eb13365..be2e2a5 100644 --- a/app/scripts/early_voting_mgr.js +++ b/app/scripts/early_voting_mgr.js @@ -25,7 +25,7 @@ define( function whenMarkerEventsHappen(eventType, marker) { if (eventType === 'click') { for (var i = 0; i < earlyVotingLocations.length; i++) { - if (marker.getPosition().equals(earlyVotingLocations[i].getGeometry().get())) { + if (marker.getPosition().equals(earlyVotingLocations[i].getGeometry().get())) { $el.scrollTo($('#location'+i), 800); } } diff --git a/app/scripts/map_service.js b/app/scripts/map_service.js index b6c14f5..4fc7457 100644 --- a/app/scripts/map_service.js +++ b/app/scripts/map_service.js @@ -53,13 +53,23 @@ define(['json!vendor/EARLY_VOTING_AddressPoints.geojson'], function createEarlyPollingMarkers() { earlyPollingLocations.forEach(function(poll, index) { - var earlyVotingMarker = new google.maps.Marker({ + var marker = new google.maps.Marker({ position: poll.getGeometry().get() + + }); + marker.addListener('click', function() { + fireMarkerEvent('click', marker); + }); + + marker.addListener('mouseover', function() { + marker.setIcon(hoverIcon); }); - earlyVotingMarker.addListener('click', function() { - fireMarkerEvent('click', earlyVotingMarker); + + marker.addListener('mouseout', function() { + marker.setIcon(defaultIcon); }); - earlyPollingMarkers.push(earlyVotingMarker); + + earlyPollingMarkers.push(marker); }); } diff --git a/app/scripts/polling_location_finder.js b/app/scripts/polling_location_finder.js index e04c094..51c3762 100644 --- a/app/scripts/polling_location_finder.js +++ b/app/scripts/polling_location_finder.js @@ -70,10 +70,8 @@ define(['jquery', return function(latLng, successCallback, errorCallback) { - var userPrecinct = getUserPrecinct(latLng); - - + if (!userPrecinct) { $('#notice') .addClass('error') @@ -84,8 +82,6 @@ define(['jquery', var destination = pollingLocation.getProperty('Address') + ', Cambridge, MA'; mapService.displayNewPollingPlace(latLng, destination, userPrecinct, successCallback, errorCallback); - // userPrecinct.setMap(map); - // map.fitBounds(userPrecinct.getBounds()); // display location notes $('#info .location').text(pollingLocation.getProperty('LOCATION')); diff --git a/app/scripts/templates/early_voting_sidebar.ejs b/app/scripts/templates/early_voting_sidebar.ejs index 1152e48..0c08d39 100644 --- a/app/scripts/templates/early_voting_sidebar.ejs +++ b/app/scripts/templates/early_voting_sidebar.ejs @@ -2,8 +2,8 @@