Fixed taginfo for relation presets

taginfo’s relation/wiki_pages method no longer places results in a data property.

Also, only use relation/wiki_pages for top-level relation presets. More specific presets behave like non-relation presets. For example, the bicycle route relation has the tags type=route route=bicycle, so route=bicycle is what we’re interested in.

Fixes #3297.
This commit is contained in:
Minh Nguyễn
2016-07-30 23:24:55 -07:00
parent 1c3a250576
commit e99afbe1c1
2 changed files with 10 additions and 3 deletions
+9 -2
View File
@@ -61,8 +61,15 @@ export function Preset(id, preset, fields) {
value = preset.tags[key];
if (geometry === 'relation' && key === 'type') {
return { rtype: value };
} else if (value === '*') {
if (value in preset.tags) {
key = value;
value = preset.tags[key];
} else {
return { rtype: value };
}
}
if (value === '*') {
return { key: key };
} else {
return { key: key, value: value };
+1 -1
View File
@@ -156,7 +156,7 @@ export function init() {
request(endpoint + path + qsString(parameters), debounce, function(err, d) {
if (err) return callback(err);
callback(null, d.data);
callback(null, parameters.rtype ? d : d.data);
});
};