Skip to content

Commit

Permalink
Handle edge IDs that are not integers
Browse files Browse the repository at this point in the history
  • Loading branch information
vasile committed Apr 20, 2012
1 parent 2054328 commit 5156f67
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions static/js/map.js
Expand Up @@ -147,10 +147,10 @@ var simulation_manager = (function(){
var edges = ab_edges.split(',');
var routePoints = [];
$.each(edges, function(k, edgeID) {
var points = network_lines[Math.abs(edgeID)];
if (edgeID < 0) {
// slice() to the rescue, otherwise reverse will alter network_lines
points = points.slice().reverse();
if (edgeID.substr(0, 1) === '-') {
var points = network_lines[edgeID.substr(1)].slice().reverse();
} else {
var points = network_lines[edgeID];
}
routePoints = routePoints.concat(points);
});
Expand Down

0 comments on commit 5156f67

Please sign in to comment.