Better publication and count of active fires in current map
This commit is contained in:
parent
96595b3aa4
commit
2fec833aef
4 changed files with 111 additions and 128 deletions
25
imports/modules/server/other-checks.js
Normal file
25
imports/modules/server/other-checks.js
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import { check, Match } from 'meteor/check';
|
||||
|
||||
export const validZoom = Match.Where((zoom) => {
|
||||
// http://wiki.openstreetmap.org/wiki/Zoom_levels
|
||||
check(zoom, Number);
|
||||
return zoom >= 0 && zoom <= 19;
|
||||
});
|
||||
|
||||
// https://github.com/3stack-software/meteor-match-library
|
||||
export function NumberBetween(min, max) {
|
||||
return Match.Where((x) => {
|
||||
check(x, Number);
|
||||
return min <= x && x <= max;
|
||||
});
|
||||
}
|
||||
|
||||
export function NullOr(type) {
|
||||
return Match.Where((x) => {
|
||||
if (x === null) {
|
||||
return true;
|
||||
}
|
||||
check(x, type);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue