Skip to content
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

trips API text color #664

Open
GerdC opened this issue Nov 19, 2024 · 6 comments
Open

trips API text color #664

GerdC opened this issue Nov 19, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@GerdC
Copy link

GerdC commented Nov 19, 2024

I'm playing around with the Motis 2 trips openapi.

Sometimes, it returns a routeColor, which is nice to give markers a color as demonstrated on https://europe.motis-project.de.

I'd like to propose to also return a textColor property, which should be available whenever a routeColor is available.

In the default Motis2 UI, the missing text color isn't obvious, as the rendered vehicle markers contain no textual clue about the route or mode.

As a user, I don't like to play memory on maps.

@felixguendling
Copy link
Member

I agree, this can be added. Feel free to open a PR if you need it urgently.

@felixguendling felixguendling added the enhancement New feature or request label Nov 19, 2024
@GerdC
Copy link
Author

GerdC commented Nov 19, 2024

The change appears to be easy at first glance, but Motis doesn't use one of the languages I'm familiar with, so I shouldn't do this, sorry.

@vkrause
Copy link
Member

vkrause commented Nov 19, 2024

Isn't this what routeTextColor provides already (if set in GTFS)?

@felixguendling
Copy link
Member

felixguendling commented Nov 19, 2024

Could be added here also:

motis/openapi.yaml

Lines 1141 to 1142 in d773eac

routeColor:
type: string

(for the trips displayed on the map, e.g. if you want to write the name on the map)

@GerdC
Copy link
Author

GerdC commented Nov 21, 2024

Code could be here

to_str(from.get_route_color(nigiri::event_type::kDep).color_),

probably something like
to_str(from.get_route_color(nigiri::event_type::kDep).text_color_)

@felixguendling
Copy link
Member

Yes, this would be the code change. Additionally the openapi.yml spec needs to be adjusted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants