Skip to content

Commit

Permalink
moved max_meters to constant
Browse files Browse the repository at this point in the history
  • Loading branch information
GrigoryDobrov committed Jul 4, 2022
1 parent 21372d7 commit 203a281
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions services/isochrone.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,14 @@ Isochrone.getContours = function(config) {
throw new Error('minutes must be less than 60');
}

var MAX_METERS = 100000;
if (
config.meters !== undefined &&
!config.meters.every(function(meter) {
return meter <= 100000;
return meter <= MAX_METERS;
})
) {
throw new Error('meters must be less than 100000');
throw new Error('meters must be less than ' + MAX_METERS);
}

if (config.generalize && config.generalize < 0) {
Expand Down

0 comments on commit 203a281

Please sign in to comment.