Show all OSM entity options when searching for a number without a prefix (close #7112)

This commit is contained in:
Quincy Morgan
2019-12-12 12:45:44 -05:00
parent f78c920916
commit f6266de357
+22
View File
@@ -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;
}