Better publication and count of active fires in current map

This commit is contained in:
vjrj 2018-01-30 18:05:11 +01:00
parent 96595b3aa4
commit 2fec833aef
4 changed files with 111 additions and 128 deletions

View 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;
});
}