mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-19 06:58:32 +02:00
Merge branch 'master' of github.com:systemed/iD. Fixes #924
This commit is contained in:
@@ -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": ""
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
Reference in New Issue
Block a user