Skip to content

Commit

Permalink
Merge pull request #134 from vsperez/tc_issue_131
Browse files Browse the repository at this point in the history
Fixes Bad request.
  • Loading branch information
scrudden committed May 14, 2019
2 parents ce19a28 + 2194b1d commit 3eac868
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ private static IpcDirectionsForRoute createStops(Route dbRoute,
if (stopId != null) {
isUiStop = false;
for (TripPattern tripPattern : uiTripPatterns) {
if(tripPattern.getDirectionId().compareTo(currentDirectionId)==0)
if((tripPattern.getDirectionId()==null && currentDirectionId==null) || tripPattern.getDirectionId().compareTo(currentDirectionId)==0)
currentTripPattern=tripPattern;
if (tripPattern.isStopAtOrAfterStop(stopId, currentStopId)) {
isUiStop = true;
Expand All @@ -233,7 +233,7 @@ private static IpcDirectionsForRoute createStops(Route dbRoute,
else
{
for (TripPattern tripPattern : uiTripPatterns) {
if(tripPattern.getDirectionId().compareTo(currentDirectionId)==0)
if((tripPattern.getDirectionId()==null && currentDirectionId==null) || tripPattern.getDirectionId().compareTo(currentDirectionId)==0)
currentTripPattern=tripPattern;
}
}
Expand Down
2 changes: 2 additions & 0 deletions transitclockWebapp/src/main/webapp/synoptic/index.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,8 @@ function routeConfigCallback(routeDetail, status)
var stop=routeDetail.routes[0].direction[i].stop[j];
distanceOverPath+=stop.pathLength;
var projectionStop=distanceOverPath/routeLenght;
if(stop.direction==undefined)
stop.direction="0";
var directionStop=(stop.direction==routeDetail.routes[0].direction[i].id=="0")?0:1;
stops.push({id: stop.id, identifier: stop.name,projection:projectionStop,direction:directionStop,distance:distanceOverPath});
}
Expand Down

0 comments on commit 3eac868

Please sign in to comment.