Skip to content

Commit

Permalink
Driving Filter
Browse files Browse the repository at this point in the history
  • Loading branch information
ingalls committed Dec 5, 2023
1 parent 8abe310 commit 2080cbd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

## Version History

### v2.3.0

- :rocket: Also allow filtering by driving

### v2.2.2

- :bug: Fix subtype
Expand Down
13 changes: 12 additions & 1 deletion task.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ export default class Task extends ETL {
},
'Show Only Active': {
type: 'boolean',
description: 'Limit Plows to showing only ones that are in motion',
description: 'Limit Plows to showing only ones that are actively transmitting',
default: true
},
'Show Only Driving': {
type: 'boolean',
description: 'Limit Plows to showing only ones that are reported as driving',
default: true
},
'DEBUG': {
Expand Down Expand Up @@ -81,6 +86,12 @@ export default class Task extends ETL {
} else {
return true;
}
}).filter((plow) => {
if (layer.environment['Show Only Driving']) {
return plow.avl_location.current_status.info === 'Driving';
} else {
return true;
}
}).map((plow) => {
const feat = {
id: plow.avl_location.vehicle.id + '_' + plow.avl_location.vehicle.id2,
Expand Down

0 comments on commit 2080cbd

Please sign in to comment.