mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 10:53:59 +00:00
fix(osm): default an absent /api/osm/features limit to 500
Without a limit parameter the route read null, Number(null) is 0, and the clamp turned that into a one-feature list. An absent or empty limit now gets the documented default of 500.
This commit is contained in:
1 parent
68667e2e3c
commit
3d2896cf27
2 files changed
+29
-1
No files matched your search
@@ -109,7 +109,13 @@ export function compileOsmFeatureQuery(request = {}) {
|
||||
? 'That area is too large to search; narrow it down.'
|
||||
: 'That area is too large to list; count first or narrow it down.',
|
||||
);
|
||||
const requested = Number(request.limit);
|
||||
// An absent or empty limit is the default, not Number(null) = 0.
|
||||
const requested =
|
||||
request.limit === null ||
|
||||
request.limit === undefined ||
|
||||
String(request.limit).trim() === ''
|
||||
? NaN
|
||||
: Number(request.limit);
|
||||
const limit = Math.max(
|
||||
1,
|
||||
Math.min(
|
||||
|
||||
Reference in new issue
Block a user