mirror of
https://github.com/FoggedLens/iD.git
synced 2026-06-02 21:21:37 +02:00
When reversing tags for joins, include "oneway"
This commit is contained in:
@@ -23,6 +23,24 @@ describe("iD.actions.Reverse", function () {
|
||||
expect(graph.entity(way.id).tags).to.eql({'oneway': 'yes'});
|
||||
});
|
||||
|
||||
it("reverses oneway tags if reverseOneway: true is provided", function () {
|
||||
var graph = iD.Graph([
|
||||
iD.Way({id: 'yes', tags: {oneway: 'yes'}}),
|
||||
iD.Way({id: 'no', tags: {oneway: 'no'}}),
|
||||
iD.Way({id: '1', tags: {oneway: '1'}}),
|
||||
iD.Way({id: '-1', tags: {oneway: '-1'}})
|
||||
]);
|
||||
|
||||
expect(iD.actions.Reverse('yes', {reverseOneway: true})(graph)
|
||||
.entity('yes').tags).to.eql({oneway: '-1'});
|
||||
expect(iD.actions.Reverse('no', {reverseOneway: true})(graph)
|
||||
.entity('no').tags).to.eql({oneway: 'no'});
|
||||
expect(iD.actions.Reverse('1', {reverseOneway: true})(graph)
|
||||
.entity('1').tags).to.eql({oneway: '-1'});
|
||||
expect(iD.actions.Reverse('-1', {reverseOneway: true})(graph)
|
||||
.entity('-1').tags).to.eql({oneway: 'yes'});
|
||||
});
|
||||
|
||||
it("transforms *:right=* ⟺ *:left=*", function () {
|
||||
var way = iD.Way({tags: {'cycleway:right': 'lane'}}),
|
||||
graph = iD.Graph([way]);
|
||||
|
||||
@@ -86,11 +86,11 @@ describe("iD.geo.joinWays", function() {
|
||||
iD.Node({id: 'b'}),
|
||||
iD.Node({id: 'c'}),
|
||||
iD.Way({id: '-', nodes: ['a', 'b']}),
|
||||
iD.Way({id: '=', nodes: ['c', 'b'], tags: {'lanes:forward': 2}})
|
||||
iD.Way({id: '=', nodes: ['c', 'b'], tags: {'oneway': 'yes', 'lanes:forward': 2}})
|
||||
]);
|
||||
|
||||
var result = iD.geo.joinWays([graph.entity('-'), graph.entity('=')], graph);
|
||||
expect(result[0][1].tags).to.eql({'lanes:backward': 2});
|
||||
expect(result[0][1].tags).to.eql({'oneway': '-1', 'lanes:backward': 2});
|
||||
});
|
||||
|
||||
it("ignores non-way members", function() {
|
||||
|
||||
Reference in New Issue
Block a user