Skip to content

Commit

Permalink
Only put live events on the voronoi map
Browse files Browse the repository at this point in the history
  • Loading branch information
fraz3alpha committed Feb 11, 2020
1 parent 0315073 commit 4864fcb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion browser-extensions/common/js/lib/challenges_ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ function createVoronoiMapPrototype() {
})

$.each(layer_data.geo_data.data.events, function(event_name, event_info) {
if (event_has_valid_location(event_info)) {
if (event_has_valid_location(event_info) && event_has_started(event_info)) {
lat_lon = [+event_info.lat, +event_info.lon]
// Add the point to the array
var point = vmap.latLngToLayerPoint(lat_lon);
Expand Down Expand Up @@ -974,6 +974,10 @@ function event_has_valid_location(event_info) {
return valid_location
}

function event_has_started(event_info) {
return (event_info.status == 'Live' || event_info.status == 'unknown')
}

function get_parkrun_popup(event_name, event_info, custom_options) {

var options = {
Expand Down

0 comments on commit 4864fcb

Please sign in to comment.