Repository navigation
Call onAddStart / onAddEnd for filter changes and tile drawing too - #24
Merged
Merged
Conversation
The collections called onAddStart only for a list that added states, and onAddEnd when those states' tiles were handed to the map, so an app could not tell that the map was still drawing after a filter that only hid states, or while the camera moved to undrawn tiles. AddProgressTracker now counts as busy while states are coming, while the map's tiler for this kind takes a list or has tiles drawn (useOverlayTileActivity), and for 400 ms after a hand-over: - any list starts (total 0 when it adds nothing); an empty list after an empty one still calls nothing; - drawing alone starts once it has lasted 200 ms, so a camera move over cached tiles calls nothing; - onAddEnd comes after 400 ms with nothing coming, handed over or drawn. Counting, progress and starting over are unchanged. Same rules as android-sdk-compose and ios-sdk.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Needs MapConductor/js-sdk-core#53. Same rules as MapConductor/android-sdk-compose and MapConductor/ios-sdk-core#48.
Why
<Circles>,<Polylines>and<Polygons>calledonAddStartonly for a list that added states, andonAddEndwhen those states' tiles were handed to the map. Drawing the tiles comes after that, so an app could not show that the map was still drawing after a filter change or a zoom.New rules
onAddStart(total): every list hand-over starts.totalis 0 when the list only removes or updates states. An empty list after an empty one calls nothing.onAddStart(0)once it has lasted 200 ms, so a move over drawn tiles calls nothing.onAddEnd(total): after 400 ms with nothing coming, handed over or drawn.onAddProgress(total, total)comes just before it whentotal> 0.For apps this means a filter that only hides states now calls start and end too, and every end comes at least 400 ms later than before. No public API change.
What
AddProgressTrackerrewritten:track(added, removedIds, size),drawingChanged, injectable timers.DRAW_START_DELAY_MSandSETTLE_MSare exported.useOverlayTileActivity(kind)finds the map's tiler activity. Circles, polylines and polygons pass it touseAddProgress; markers pass only the size.test/addProgress.test.mjsrewritten; 27 tests pass, api surface dumped.Checked (antenna sample, Chrome)