mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 09:12:52 +00:00
Don't add addr:housenumber=yes when applying Address preset (#1874)
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
"tags": {
|
||||
"addr:housenumber": "*"
|
||||
},
|
||||
"addTags": {},
|
||||
"matchScore": 0.2,
|
||||
"name": "Address"
|
||||
},
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"tags": {
|
||||
"addr:housenumber": "*"
|
||||
},
|
||||
"addTags": {},
|
||||
"matchScore": 0.2,
|
||||
"name": "Address"
|
||||
}
|
||||
@@ -73,7 +73,7 @@ iD.presets.Preset = function(id, preset, fields) {
|
||||
return tags;
|
||||
};
|
||||
|
||||
var applyTags = preset.applyTags || preset.tags;
|
||||
var applyTags = preset.addTags || preset.tags;
|
||||
preset.applyTags = function(tags, geometry) {
|
||||
tags = _.clone(tags);
|
||||
|
||||
|
||||
@@ -69,6 +69,11 @@ describe('iD.presets.Preset', function() {
|
||||
expect(preset.applyTags({}, 'area')).to.eql({building: 'yes'});
|
||||
});
|
||||
|
||||
it("prefers to add tags of addTags property", function() {
|
||||
var preset = iD.presets.Preset('test', {tags: {building: '*'}, addTags: {building: 'ok'}});
|
||||
expect(preset.applyTags({}, 'area')).to.eql({building: 'ok'});
|
||||
});
|
||||
|
||||
it("adds default tags of fields with matching geometry", function() {
|
||||
var field = iD.presets.Field('field', {key: 'building', geometry: 'area', default: 'yes'}),
|
||||
preset = iD.presets.Preset('test', {fields: ['field']}, {field: field});
|
||||
|
||||
Reference in New Issue
Block a user