mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 05:30:35 +02:00
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:
@@ -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 };
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user