Merge branch 'master' of github.com:systemed/iD. Fixes #924

This commit is contained in:
Tom MacWright
2013-03-08 14:07:12 -05:00
4 changed files with 58 additions and 1 deletions
+20
View File
@@ -1445,6 +1445,26 @@
"form": [],
"icon": ""
},
{
"name": "construction",
"match": {
"type": [
"area"
],
"tags": {
"landuse": "construction"
},
"terms": []
},
"form": [
{
"key": "construction",
"type": "combo"
},
"operator"
],
"icon": ""
},
{
"name": "farm",
"match": {
@@ -0,0 +1,21 @@
{
"name": "construction",
"match": {
"type": [
"area"
],
"tags": {
"landuse": "construction"
},
"terms": [
]
},
"form": [
{
"key": "construction",
"type": "combo"
},
"operator"
],
"icon": ""
}
+1 -1
View File
@@ -73,7 +73,7 @@ iD.Entity.prototype = {
var t1 = merged[k],
t2 = tags[k];
if (t1 && t1 !== t2) {
merged[k] = t1 + ';' + t2;
merged[k] = _.union(t1.split(/;\s*/), t2.split(/;\s*/)).join(';');
} else {
merged[k] = t2;
}
+16
View File
@@ -88,6 +88,22 @@ describe('iD.Entity', function () {
b = a.mergeTags({a: 'b'});
expect(b.tags).to.eql({a: 'a;b'});
});
it("combines combined tags", function () {
var a = iD.Entity({tags: {a: 'a;b'}}),
b = iD.Entity({tags: {a: 'b'}});
expect(a.mergeTags(b.tags).tags).to.eql({a: 'a;b'});
expect(b.mergeTags(a.tags).tags).to.eql({a: 'b;a'});
});
it("combines combined tags with whitespace", function () {
var a = iD.Entity({tags: {a: 'a; b'}}),
b = iD.Entity({tags: {a: 'b'}});
expect(a.mergeTags(b.tags).tags).to.eql({a: 'a;b'});
expect(b.mergeTags(a.tags).tags).to.eql({a: 'b;a'});
});
});
describe("#osmId", function () {