Skip to content

Commit

Permalink
fix species filter
Browse files Browse the repository at this point in the history
  • Loading branch information
stevage committed Oct 7, 2024
1 parent a0cd666 commit fdcc663
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/components/Map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,19 @@ export default {
});
EventBus.$on('vis-mode', mode => this.$nextTick(() => this.mode = mode))
EventBus.$on('resize', () => this.$nextTick(() => this.map.resize()));
EventBus.$on('species-filter', filter => map.U.setFilter([...visLayers, 'trees-inner'], [
'any',
['in', filter, ['get', 'scientific']],
['in', filter, ['get', 'genus']]
]));
EventBus.$on('species-filter', (filter) =>
map.U.setFilter(
[...visLayers, 'trees-inner'],
filter
? [
'any',
['in', filter, ['get', 'scientific']],
['in', filter, ['get', 'genus']],
['in', filter, ['get', 'common']],
]
: true
)
);
map.on('moveend', () => {
if (this.mode === 'local') {
this.updateLocal();
Expand Down

0 comments on commit fdcc663

Please sign in to comment.