mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 05:30:35 +02:00
Return an indirect u-turn restriction for an only restriction
This commit is contained in:
@@ -490,7 +490,7 @@ export function osmIntersection(graph, startVertexId, maxDistance) {
|
||||
// an indirect restriction - only include the partial path (starting at FROM)
|
||||
if (matchedRestriction && matchedRestriction.direct === false) {
|
||||
for (i = 0; i < turnPath.length; i++) {
|
||||
if (i > 0 && turnPath[i] === matchedRestriction.from) {
|
||||
if (turnPath[i] === matchedRestriction.from) {
|
||||
turnPath = turnPath.slice(i);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -340,7 +340,6 @@ describe('iD.osmIntersection', function() {
|
||||
expect(turns[1].u).to.be.not.ok;
|
||||
expect(turns[1].restrictionID).to.eql('r');
|
||||
expect(turns[1].direct).to.be.true;
|
||||
expect(turns[1].indirect).to.be.not.ok;
|
||||
expect(turns[1].only).to.be.not.ok;
|
||||
});
|
||||
|
||||
@@ -369,21 +368,21 @@ describe('iD.osmIntersection', function() {
|
||||
expect(turns[0]).to.be.an.instanceOf(iD.osmTurn);
|
||||
expect(turns[0].key).to.eql('=_*_=');
|
||||
expect(turns[0].u).to.be.true;
|
||||
expect(turns[1].direct).to.be.false;
|
||||
expect(turns[1].only).to.be.not.ok;
|
||||
|
||||
expect(turns[1]).to.be.an.instanceOf(iD.osmTurn);
|
||||
expect(turns[1].key).to.eql('=_*_~');
|
||||
expect(turns[1].restrictionID).to.eql('r');
|
||||
expect(turns[1].u).to.be.not.ok;
|
||||
expect(turns[1].direct).to.be.not.ok;
|
||||
expect(turns[1].indirect).to.be.true;
|
||||
expect(turns[1].direct).to.be.false;
|
||||
expect(turns[1].only).to.be.not.ok;
|
||||
|
||||
expect(turns[2]).to.be.an.instanceOf(iD.osmTurn);
|
||||
expect(turns[2].key).to.eql('=_*_-');
|
||||
expect(turns[2].restrictionID).to.eql('r');
|
||||
expect(turns[2].u).to.be.not.ok;
|
||||
expect(turns[2].direct).to.be.not.ok;
|
||||
expect(turns[2].indirect).to.be.not.ok;
|
||||
expect(turns[2].direct).to.be.true;
|
||||
expect(turns[2].only).to.be.true;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user