Created
June 25, 2012 23:06
-
-
Save Andrewglass1/2992018 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var applyAllFilters = function() { | |
_.each(visibleMarkers(), function(marker) { | |
Gmaps.map.showMarker(marker) | |
}) | |
}; | |
var visibleMarkers = function() { | |
var filtered = _.reject(Gmaps.map.markers, function(marker) { | |
return marker.revenue < PriceRangeFilter.min || marker.revenue > PriceRangeFilter.max; | |
}); | |
filtered = _.reject(filtered, function(marker) { | |
return marker.days_since < DateRangeFilter.recent || marker.days_since > DateRangeFilter.oldest | |
}); | |
_.each(AllPropertyFilters, function(filter){ | |
filtered = _.reject(filtered, function(marker) { | |
return marker[filter.name] == filter.value && filter.shouldShow == "unchecked" | |
}); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment