mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
Updating regex to simplify and account for leading zeros in the element id.
This commit is contained in:
@@ -122,11 +122,11 @@ export function uiFeatureList(context) {
|
||||
|
||||
if (!q) return result;
|
||||
|
||||
var idMatch = q.match(/^(.*[^\w])?(node|n|way|w|relation|r)[^\w]?([0-9]+)([^\w].*)?$/i);
|
||||
var idMatch = q.match(/(?:^|\W)(node|way|relation|[nwr])\W?0*([1-9]\d*)(?:\W|$)/i);
|
||||
|
||||
if (idMatch) {
|
||||
var elemType = idMatch[2][0];
|
||||
var elemId = idMatch[3];
|
||||
var elemType = idMatch[1].charAt(0);
|
||||
var elemId = idMatch[2];
|
||||
result.push({
|
||||
id: elemType + elemId,
|
||||
geometry: elemType === 'n' ? 'point' : elemType === 'w' ? 'line' : 'relation',
|
||||
|
||||
Reference in New Issue
Block a user