From f6266de357f55200ed0818137d1569dc38120284 Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Thu, 12 Dec 2019 12:45:44 -0500 Subject: [PATCH] Show all OSM entity options when searching for a number without a prefix (close #7112) --- modules/ui/feature_list.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/modules/ui/feature_list.js b/modules/ui/feature_list.js index 9ee43b3698..b01fd25a5b 100644 --- a/modules/ui/feature_list.js +++ b/modules/ui/feature_list.js @@ -207,6 +207,28 @@ export function uiFeatureList(context) { } }); + if (q.match(/^[0-9]+$/)) { + // if query is just a number, possibly an OSM ID without a prefix + result.push({ + id: 'n' + q, + geometry: 'point', + type: t('inspector.node'), + name: q + }); + result.push({ + id: 'w' + q, + geometry: 'line', + type: t('inspector.way'), + name: q + }); + result.push({ + id: 'r' + q, + geometry: 'relation', + type: t('inspector.relation'), + name: q + }); + } + return result; }