-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only render routeName badge when routeName exists #723
Only render routeName badge when routeName exists #723
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm very curious how you figured this out/why this works!
@@ -37,7 +37,7 @@ export function patternToRouteFeature( | |||
const properties = { | |||
color: `#${route.route_color || "000080"}`, | |||
name: routeName, | |||
nameUpper: routeNameUpper, | |||
nameUpper: routeName.length === 0 ? "" : routeNameUpper, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a WILD hack how did you figure this out???
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
routeNameUpper
is what generates the background box, and it defaults to "EEE" if the routeName.length
is smaller than 3! This just skips it entirely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But you're setting a string with length 0 only when the string length is 0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, to clarify, nameUpper
, which is what we're setting here, generates the background box. routeNameUpper
will default to EEE, so setting it to an empty string removes the background box entirely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the EEE thing is breaking me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh that's right, I did that so that the box for short route numbers still looks rectangular...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
@@ -37,7 +37,7 @@ export function patternToRouteFeature( | |||
const properties = { | |||
color: `#${route.route_color || "000080"}`, | |||
name: routeName, | |||
nameUpper: routeNameUpper, | |||
nameUpper: routeName.length === 0 ? "" : routeNameUpper, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh that's right, I did that so that the box for short route numbers still looks rectangular...
Small fix to only show background for transitive route name badge if we are passing a route name.