Skip to content

Commit

Permalink
Show all OSM entity options when searching for a number without a pre…
Browse files Browse the repository at this point in the history
…fix (close #7112)
  • Loading branch information
quincylvania committed Dec 12, 2019
1 parent f78c920 commit f6266de
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions modules/ui/feature_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit f6266de

Please sign in to comment.