Skip to content

Commit

Permalink
Merge pull request #346 from headwaymaps/mkirk/www-tweak-route-colors
Browse files Browse the repository at this point in the history
[www] tweak route colors
  • Loading branch information
michaelkirk committed Apr 18, 2024
2 parents 3545657 + ff79bfc commit 0a872c6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
14 changes: 8 additions & 6 deletions services/frontend/www-app/src/models/Trip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,10 @@ export class TripLeg {
if (this.mode == TravelMode.Walk || this.mode == TravelMode.Bike) {
return LineStyles.walkingActive;
} else {
if (this.raw.routeColor) {
return LineStyles.activeColored(`#${this.raw.routeColor}`);
if (this.raw.transitLeg?.routeColor) {
return LineStyles.activeColored(
`#${this.raw.transitLeg?.routeColor}`,
);
} else {
return LineStyles.active;
}
Expand Down Expand Up @@ -201,20 +203,20 @@ export const LineStyles = {
};
},
active: {
'line-color': '#1976D2',
'line-color': '#1296FF',
'line-width': 6,
},
inactive: {
'line-color': '#777',
'line-color': '#6FC1EE',
'line-width': 4,
},
walkingActive: {
'line-color': '#1976D2',
'line-color': '#1296FF',
'line-dasharray': [0, 1.5],
'line-width': 8,
},
walkingInactive: {
'line-color': '#777',
'line-color': '#6FC1EE',
'line-dasharray': [0, 1.5],
'line-width': 8,
},
Expand Down
8 changes: 6 additions & 2 deletions services/frontend/www-app/src/services/TravelmuxClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import { LngLat } from 'maplibre-gl';
import { DistanceUnits, TravelMode } from 'src/utils/models';
import { Ok, Err, Result } from 'src/utils/Result';
import Trip, { TripFetchError } from 'src/models/Trip';
import { OTPPlanResponse, OTPItinerary } from './OpenTripPlannerAPI';
import {
OTPPlanResponse,
OTPItinerary,
OTPItineraryLeg,
} from './OpenTripPlannerAPI';
import {
ValhallaRouteResponse,
ValhallaRoute,
Expand All @@ -27,7 +31,7 @@ export interface TravelmuxLeg {
distanceMeters: number;
duration: number;
geometry: string;
routeColor?: string;
transitLeg?: OTPItineraryLeg;
}

export interface TravelmuxItinerary {
Expand Down

0 comments on commit 0a872c6

Please sign in to comment.