Created
September 19, 2018 19:08
-
-
Save miklb/05f4bc5af283a064434d078f91e8178b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
$('.menu-ui a').on('click', function() { | |
// For each filter link, get the 'data-filter' attribute value. | |
var filter = $(this).data('filter'); | |
$(this).addClass('active').siblings().removeClass('active'); | |
markers.setFilter(function(f) { | |
// If the data-filter attribute is set to "all", return | |
// all (true). Otherwise, filter on markers that have | |
// a value set to true based on the filter name. | |
return (filter === 'all') ? true : f.properties[filter] === true; | |
}); | |
return false; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment