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

Performance issue when zoomed out #31

Open
RobertLucey opened this issue Nov 7, 2021 · 1 comment
Open

Performance issue when zoomed out #31

RobertLucey opened this issue Nov 7, 2021 · 1 comment

Comments

@RobertLucey
Copy link
Collaborator

RobertLucey commented Nov 7, 2021

https://github.com/conor-f/via-web/blob/main/vue/via-web/src/components/ViaMap.vue#L135

This is called too much and performance is awful when zoomed out and the table is open. Will only get worse

Mainly noticable when moving around the map by dragging

@conor-f
Copy link
Owner

conor-f commented Nov 8, 2021

Cool. This callback is every map move/update and updating the latLngBounds tries to filter the table which involves running through every visible road segment in the geojson. Potential fixes are:

  1. Only show the table view above a certain zoomLevel or when the latLngBounds cover < X km^2
  2. Only show a sample of the data when in the table when the latLngBounds or zoomLevel are too expansive
  3. Show an API loading spinner in the table view when updating like this. It's async so it shouldn't have any performance impact for moving the map around but I'm not certain.
  4. Limit the zoomLevel on the map itself so you can never get to a point where this is an issue

Definitely more solutions too. Will keep it in mind going forward.

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

No branches or pull requests

2 participants