Skip to content

Conversation

Dlurak
Copy link
Collaborator

@Dlurak Dlurak commented Jul 7, 2024

//edit zbycz: add example: https://osmapp.org/node/2470201868

This fixes #399.
image

Also the routes are know shown on the map, so that #168 would be fixed completely:

image

Possible improvements (for a follow up?):

  • Detect routes using other tags, e.g. bus routes, subways, ferries...
  • Colorize the routes on the map

Copy link

vercel bot commented Jul 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
osmapp ✅ Ready (Inspect) Visit Preview Sep 21, 2024 6:22am

@Dlurak Dlurak changed the title FeaturePanel: Categorize public transport routes FeaturePanel: Categorize public transport routes and show them on the map Jul 13, 2024
@Dlurak
Copy link
Collaborator Author

Dlurak commented Jul 15, 2024

I think it would have been better if I've opened a new pr for showing the routes on the map, sorry about that

Copy link
Owner

@zbycz zbycz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quite impresive, that looks very good.

I try to be strict on code quality, because otherwise the maintainability of this project would be hard 🙂

I reviewed some more obvious parts, once you address/comment the issues, i will comment more on code structure.

@zbycz
Copy link
Owner

zbycz commented Sep 13, 2024

Related issue: #538

@jvaclavik
Copy link
Collaborator

@Dlurak Are you going to finish this one? I really like how you showing railroads on the map ❤️

@Dlurak
Copy link
Collaborator Author

Dlurak commented Sep 18, 2024

Oh of course, sorry I just forgot about it. Probably this evening or tommorow

@Dlurak
Copy link
Collaborator Author

Dlurak commented Sep 19, 2024

Now the code fetches the master relations which can't be directly displayed on the map. I will fix this later

@Dlurak Dlurak force-pushed the PublictransportCategoriess branch from 793663c to 1c8ac79 Compare September 19, 2024 11:25
- Changed public transport fetching
- Updated id tagging presets
@Dlurak
Copy link
Collaborator Author

Dlurak commented Sep 19, 2024

The routes aren't shown on the map in a server rendered environment because getGlobalMap returns undefined. But else it should be ready @zbycz

zbycz
zbycz previously approved these changes Sep 21, 2024
Copy link
Owner

@zbycz zbycz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks fine. Ready to merge. 👍

type OverpassGeoJson = Feature & {
osmMeta: {
type: string;
id: number;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really needed? Feature already has osmMeta with type:string+id:number. It was changed recently.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I needed it while debugging and it seems like I forgot to remove it

@zbycz
Copy link
Owner

zbycz commented Sep 21, 2024

The routes aren't shown on the map in a server rendered environment because getGlobalMap returns undefined. But else it should be ready @zbycz

It works for me fine. In SSR there will never be any useEffect nor ReactQuery fired anyway. I think it is better to let SSR only handle main part of FeaturePanel and let this PublicTransport component be rendered only on client – there the map exists ok, right?

@zbycz
Copy link
Owner

zbycz commented Sep 21, 2024

This will be even better once we finish #214, so people can click a (master) route and see its outline as well. Feel free to take it if you want.

@Dlurak Dlurak enabled auto-merge (squash) September 21, 2024 06:19
@Dlurak Dlurak merged commit 219e315 into zbycz:master Sep 21, 2024
2 checks passed
@amenk
Copy link
Contributor

amenk commented Sep 21, 2024

Wow, this is pretty cool. But I am not sure if we should show all the routes by default on the map.
For example https://osmapp.org/node/2470201868#8.48/48.4996/12.3864 marks half of Germany / even Europe red ;-)

Would it make more sense

  1. to use a similar method for relation display (i.e. when clicking a route https://osmapp.org/relation/17329553#17.00/48.3443/11.8086)

  2. to eventually let the user toggle routes or group of routes (all regional trains for example) if they want to display multiple routes? (there still could be an "all" button to have the behavior as it is in the moment)

@Dlurak Dlurak deleted the PublictransportCategoriess branch September 30, 2024 22:37
@Dlurak
Copy link
Collaborator Author

Dlurak commented Oct 9, 2024

to eventually let the user toggle routes or group of routes (all regional trains for example)

I absolutely love that idea! Designwise I am quite unsure how to do it. @zbycz do you maybe have an idea?

@zbycz
Copy link
Owner

zbycz commented Oct 10, 2024

I absolutely love that idea! Designwise I am quite unsure how to do it.

I think the query should be split in two, first one "quick" would only download the data needed for the PublicTransportDisplay component.

There below it could be a toggle (eg https://mui.com/material-ui/react-switch/ + "Show routes on map") which would load the geometry request which can take longer time ~ 10 MB.

@Dlurak
Copy link
Collaborator Author

Dlurak commented Oct 17, 2024

@amenk your second idea is implemented and deployed on OsmAPP.
The first one relies on #214

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

Successfully merging this pull request may close these issues.

Public transport categories
4 participants