Skip to content

Commit

Permalink
Use different colors for vehicles even if no :day
Browse files Browse the repository at this point in the history
  • Loading branch information
senhalil committed Oct 12, 2021
1 parent b03acba commit b7fbc60
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/output_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -459,15 +459,15 @@ def self.generate_points_geometry(result)
def self.generate_polylines_geometry(result)
polylines = []

result[:routes].each{ |route|
result[:routes].each_with_index{ |route, route_index|
next unless route[:geometry]

color = compute_color([], nil, route[:day])
color = route[:day] ? compute_color([], nil, route[:day]) : compute_color([], :vehicle, route_index)
polylines << {
type: 'Feature',
properties: {
color: color,
name: "#{route[:original_vehicle_id]}, day #{route[:day]} route",
name: "#{route[:original_vehicle_id]}#{route[:day] ? '' : ", day #{route[:day]} route"}",
vehicle: route[:original_vehicle_id],
day: route[:day]
},
Expand Down

0 comments on commit b7fbc60

Please sign in to comment.