Skip to content

Commit

Permalink
Change map line color for external ferries to #666.
Browse files Browse the repository at this point in the history
  • Loading branch information
VillePihlava committed Oct 3, 2024
1 parent 829f941 commit acd269b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
33 changes: 14 additions & 19 deletions app/component/map/Line.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ export default class Line extends React.Component {
if (this.props.mode === 'walk') {
legWeight *= 0.8;
}
if (this.props.mode === 'ferry-external') {
haloWeight *= 0.6;
legWeight *= 0.6;
}
if (this.props.passive) {
haloWeight *= 0.5;
legWeight *= 0.5;
Expand All @@ -111,27 +115,18 @@ export default class Line extends React.Component {
legWeight *= 0.5;
}

// The halo is not needed for lines that use the external color.
// At least currently the outline (halo) is very visible with the external gray color.
const displayHalo = !(
this.context.config.externalFeedIds !== undefined &&
this.props.mode.includes('external')
);

return (
<div style={{ display: 'none' }}>
{displayHalo && (
<Polyline
key="halo"
ref={el => {
this.halo = el;
}}
positions={filteredPoints}
className={`leg-halo ${className}`}
weight={haloWeight}
interactive={false}
/>
)}
<Polyline
key="halo"
ref={el => {
this.halo = el;
}}
positions={filteredPoints}
className={`leg-halo ${className}`}
weight={haloWeight}
interactive={false}
/>
<Polyline
key="line"
ref={el => {
Expand Down
4 changes: 4 additions & 0 deletions app/component/map/map.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1304,6 +1304,10 @@ div.origin-popup {
stroke-opacity: 0.5;
}

.map-line.ferry-external.leg {
color: $external-feed-map-color;
}

/* Fix to default leaflet behavior */
.leaflet-map-pane svg {
position: relative;
Expand Down
1 change: 1 addition & 0 deletions sass/themes/default/_theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ $car-color: #333;
$scooter-color: #c5cad2;
$call-agency-color: #666;
$external-feed-color: #c5cad2;
$external-feed-map-color: #666;

/* Fonts */
$font-family: 'Roboto', arial, georgia, serif;
Expand Down

0 comments on commit acd269b

Please sign in to comment.