From 266b7f0dd682c743e7aae71ca56574fedb6f3ed4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florent=20B=C3=A9jina?= Date: Mon, 10 Aug 2020 11:02:00 +0200 Subject: [PATCH] add gslimit parameter to geoSearch --- src/wiki.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/wiki.js b/src/wiki.js index 55dd742..96e3c19 100644 --- a/src/wiki.js +++ b/src/wiki.js @@ -215,13 +215,15 @@ export default function wiki(options = {}) { * @param {Number} lat - latitude * @param {Number} lon - longitude * @param {Number} [radius=1000] - search radius in kilometers (default: 1km) + * @param {Number} [limit=10] - number of results (default: 10 results) * @return {Promise} - List of page titles */ - function geoSearch(lat, lon, radius = 1000) { + function geoSearch(lat, lon, radius = 1000, limit = 10) { return api(apiOptions, { list: 'geosearch', gsradius: radius, - gscoord: `${lat}|${lon}` + gscoord: `${lat}|${lon}`, + gslimit: limit }).then(res => res.query.geosearch.map(article => article.title)); }