Skip to content

Redraw a marker when its URL icon's image arrives - #10

Merged
wf9a5m75 merged 2 commits into
developfrom
feat/image-icon-url
Nov 6, 2026
Merged

wf9a5m75 merged 2 commits into
developfrom
feat/image-icon-url

Conversation

@wf9a5m75

@wf9a5m75 wf9a5m75 commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

The Longdo marker overlay remembers the marker bitmap per icon. A URL ImageIcon (MapConductor/android-sdk-core#23, merged) is the same object before and after its image arrives, so the overlay kept drawing the transparent placeholder.

The bitmap is now keyed on marker.icon and marker.iconRevision. iconRevision is Compose state that core bumps when the icon's image arrives, so reading it also makes the overlay recompose at that moment.

Verified on TB520FU with an icon URL delayed by 8 s: only the label at ~5 s, the icon at ~15 s.

ImageIcon(imageUrl = ...) keeps the same instance when its image arrives;
only its hashCode changes, and MarkerState makes the icon read recompose.
Key the remembered bitmap on the hash as well, or the overlay keeps the
transparent placeholder.
MarkerState.icon no longer reads Compose state; iconRevision is the counter
that goes up when a URL icon's image arrives. Reading it also makes the
overlay recompose then.
@wf9a5m75
wf9a5m75 merged commit 9707c7b into develop Nov 6, 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