Skip to content

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

Merged
wf9a5m75 merged 1 commit into
developfrom
feat/tile-activity-progress
Nov 21, 2026
Merged

wf9a5m75 merged 1 commit into
developfrom
feat/tile-activity-progress

Conversation

@wf9a5m75

Copy link
Copy Markdown
Contributor

The same rules as MapConductor/android-sdk-compose and MapConductor/js-sdk-react (PRs of the same name).

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. A filter that only hides states, or a camera move to undrawn tiles, called nothing, so an app could not show that the map was still drawing.

What

  • TileActivity: busy while a ShapeTiler routes a list or its ShapeTileRenderer draws a tile. The circle, polyline and polygon tilers expose it. A collection finds its map's tilers through the provider's OverlayControllerRegistryKey when it joins the content.
  • AddProgressTracker counts as busy while states are coming, while those tilers draw, and for 0.4 s after a hand-over:
    • Any list starts. total is 0 when the list adds nothing. An empty list after an empty one calls nothing.
    • Drawing alone starts once it has lasted 0.2 s, so a camera move over drawn tiles calls nothing.
    • onAddEnd comes after 0.4 s with nothing coming, handed over or drawn. onAddProgress(total, total) comes just before it when total > 0.
    • Callbacks still wait for the view update to end. Starting over when new states come mid-add is unchanged.

All of it is internal; no public API change. 566 tests pass.

scripts/api-surface.sh check ios-sdk-core already fails on develop: the onAdd* parameters added earlier are not in the recorded surface. This PR does not change that.

Checked

Antenna sample (723,800 circles) on an iPad Pro 11-inch, Google Maps: after turning Verizon off the sample showed "Drawing the map…" and cleared it once the tiles were drawn. Turning it on showed "Adding to the map… 0 / 147,164".

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.

- TileActivity: busy while a ShapeTiler routes a list or its
  ShapeTileRenderer draws a tile. Circle, polyline and polygon tilers
  expose it; a collection looks its map's tilers up through the provider's
  OverlayControllerRegistryKey when it joins the content.
- AddProgressTracker counts as busy while states are coming, while those
  tilers are busy, and for 0.4 s after a hand-over: any list starts (total 0
  when it adds nothing, nothing for an empty list after an empty one),
  drawing alone starts once it has lasted 0.2 s, and onAddEnd comes after
  0.4 s with nothing coming, handed over or drawn. Callbacks still wait for
  the view update to end. Same rules as android-sdk-compose and
  js-sdk-react.
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