-
Notifications
You must be signed in to change notification settings - Fork 2
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
Comments
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. |
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. |
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. |
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.
The text was updated successfully, but these errors were encountered: