Skip to content

Add onAddStart/onAddProgress/onAddEnd to Markers, Circles, Polylines, Polygons - #16

Merged
wf9a5m75 merged 1 commit into
developfrom
feat/add-progress
Nov 13, 2026
Merged

wf9a5m75 merged 1 commit into
developfrom
feat/add-progress

Conversation

@wf9a5m75

Copy link
Copy Markdown
Contributor

These callbacks show that a long list is being put on the map. They mean the same as in js-sdk-react (MapConductor/js-sdk-react#17):

  • onAddStart(total): the list brings states the map does not have yet.
  • onAddProgress(added, total): at most every 100 ms, and once more at added == total.
  • onAddEnd(total): all of them are on the map. This is the same moment as their onAdded; for tiled states, that is when their tiles were handed to the map.
  • A state removed before it arrives no longer counts. A new list that adds states starts over. A list that only updates or removes calls nothing. All three run on the main thread.

The diff runs on Dispatchers.Default as before. track() now runs on the main thread just before the collector update, so that no arrival comes ahead of it.

  • Needs MapConductor/android-sdk-core OverlayAddedListeners. Standalone CI clones core's develop, so it fails until that PR is merged.
  • Binary change: the four functions gain three parameters with defaults. Source compatible; modules compiled against the old signature need a rebuild, and they are released together through the BOM.

Tests: AddProgressTrackerTest, the same cases as the React test. Device: on the antenna-horizons page (723,800 circles, MapLibre, tablet HA26Z6JL), start 723800 came at 2.3 s; all of them arrived at 11.1 s, followed by progress 723800/723800 and end.

… Polygons

A list of thousands shows nothing until it is drawn; these say the work is going on.
They count the states a list brings by the same moment as each state's onAdded,
report progress at most every 100 ms, and start over when a new list adds states.
The same as the js-sdk-react collections.
@wf9a5m75
wf9a5m75 merged commit 4607971 into develop Nov 13, 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