Skip to content

Instantly share code, notes, and snippets.

@Andrewglass1
Created June 25, 2012 23:06
Show Gist options
  • Save Andrewglass1/2992018 to your computer and use it in GitHub Desktop.
Save Andrewglass1/2992018 to your computer and use it in GitHub Desktop.
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