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

Need to change GeoJSON layer strategy to avoid redraw of existing items #8

Closed
mvl22 opened this issue Jul 3, 2017 · 3 comments
Closed

Comments

@mvl22
Copy link
Member

mvl22 commented Jul 3, 2017

When the map is panned, the GeoJSON layer is reloaded and the geometries fully-redrawn.

This should be changed so that existing items which were present before, and which remain after, should not be withdrawn. This would avoid the problem of an opened popup bubble disappearing during the scroll.

The CycleStreets Photomap avoids this problem by using a registry cache strategy to hold the current list of IDs and skip those in the list.

@mvl22
Copy link
Member Author

mvl22 commented Aug 13, 2017

This causes the problem that open popup are lost as the screen is redrawn.

This is particularly problematic when the popup is a large size, because Leaflet is more likely to try to attempt to re-centre the screen to ensure the popup is not partially hidden, at which point it is then lost.

@mvl22
Copy link
Member Author

mvl22 commented Jun 19, 2019

This will happen as part of #24, where the underlying library fundamentally uses a different approach of defining a source (with rendering) and then supplying the data, which automatically does a diff/replace.

@mvl22
Copy link
Member Author

mvl22 commented Jul 4, 2020

This was essentially fixed in the switch from Leaflet.js to MapboxGL.js. The latter uses a different pattern: a layer is registered, with styles up-front, and then the data is fetched with reference to that layer.

@mvl22 mvl22 closed this as completed Jul 4, 2020
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

1 participant