mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-22 08:17:30 +02:00
Adding test case for lanes().default
This commit is contained in:
committed by
Bryan Housel
parent
4083a0e29e
commit
07827e5a2d
+11
-11
@@ -101,16 +101,17 @@ _.extend(Way.prototype, {
|
||||
},
|
||||
|
||||
lanes: function() {
|
||||
function parseTurnLane(str) {
|
||||
if (!str || str === '') return null;
|
||||
|
||||
return str.split('|').map(function(s) {
|
||||
return s.split(';');
|
||||
});
|
||||
}
|
||||
|
||||
if (!this.tags.highway) return null;
|
||||
|
||||
var defaultLanes = {}, tagged = {};
|
||||
|
||||
switch (this.tags.highway) {
|
||||
case 'service':
|
||||
case 'track':
|
||||
case 'path':
|
||||
defaultLanes.count = this.isOneWay() ? 1 : 2;
|
||||
break;
|
||||
case 'trunk':
|
||||
case 'motorway':
|
||||
defaultLanes.count = this.isOneWay() ? 2 : 4;
|
||||
@@ -120,11 +121,10 @@ _.extend(Way.prototype, {
|
||||
break;
|
||||
}
|
||||
|
||||
if (!this.isOneWay()) {
|
||||
defaultLanes.forward = defaultLanes.count/2;
|
||||
defaultLanes.backward = defaultLanes.count/2;
|
||||
} else {
|
||||
if (this.isOneWay()) {
|
||||
tagged.oneway = 'yes';
|
||||
} else {
|
||||
tagged.oneway = 'no';
|
||||
}
|
||||
|
||||
tagged.lanes = {};
|
||||
|
||||
Reference in New Issue
Block a user