Skip to content

Call onAddStart / onAddEnd for filter changes and tile drawing too - #21

Merged
wf9a5m75 merged 2 commits into
developfrom
feat/tile-activity-progress
Nov 21, 2026
Merged

wf9a5m75 merged 2 commits into
developfrom
feat/tile-activity-progress

Conversation

@wf9a5m75

Copy link
Copy Markdown
Contributor

Stacked on #20. Needs MapConductor/android-sdk-core#58. Same rules as MapConductor/js-sdk-react and MapConductor/ios-sdk-core#48.

Why

Circles, Polylines and Polygons called onAddStart only for a list that added states, and onAddEnd when 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 carrier toggle or a zoom.

New rules

  • onAddStart(total): every list hand-over starts. total is 0 when the list only removes or updates states. An empty list after an empty one calls nothing.
  • Tile drawing alone (a camera move) starts with 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 when total > 0.
  • Unchanged: progress at most every 100 ms, and starting over when new states come while others are being added.

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

  • AddProgressTracker rewritten with drawingChanged; rememberAddProgress follows the tilers' active flows.
  • LocalOverlayTileActivity hands the collections overlayTileActivity(kind). MapViewBase provides it; the default is empty, so composables without a controller (and unit tests) still work.
  • AddProgressTrackerTest rewritten (11 tests). 23 tests pass, apiCheck passes.

Providers that provide their own composition locals (MapTiler, Longdo) do not get the drawing signal yet; hand-overs still start and end there.

Checked (antenna sample, Pixel 5a)

  • Verizon off: start at the tap, end 405 ms after the last tile.
  • Zoom: start 200 ms into the drawing, end 405 ms after the last tile.

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 tilers for this kind take a list or draw tiles
(LocalOverlayTileActivity, provided by MapViewBase), 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.
AddProgress.kt: keep this branch's tracker, which already releases the pending table once every state has arrived (as develop's da49d89 does), and carry over the table-sizing comment.
@wf9a5m75
wf9a5m75 merged commit afac43b into develop Nov 21, 2026
2 checks passed
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.

1 participant