Repository navigation
Let ImageIcon and GroundImageState take an image URL - #23
Merged
Merged
Conversation
ImageIcon(imageUrl = ...) and GroundImageState(bounds, imageUrl = ...) load the image themselves, matching react-sdk's GroundImageState.imageUrl. Until it arrives the icon is transparent at its final size and anchor (a label is still drawn) and the ground image is a 1 px transparent placeholder; when it arrives the markers and ground images using it are redrawn. - RemoteImageLoader fetches each URL once (http, https, file, data), keeps up to 32 MB of decoded bitmaps, remembers a failure for 30 s and logs it once. No new dependencies: HttpURLConnection with redirects followed by hand, as in android-kml's KMLLoader. - A URL icon's hash is the URL plus whether the image has arrived, so it changes exactly once. toBitmapIcon() and the tile parts stay synchronous; BitmapIconCache keeps the placeholder and the real bitmap apart. - MarkerState hears when a pending URL icon arrives and reports a write, but only if it still carries that icon. Nothing else re-reads icons, so without this the placeholder would stay until some other field changed. - GroundImageState.imageUrl swaps `image` to the loaded bitmap if the URL is still the same; setting `image` clears imageUrl. copy() keeps the URL. Public API: additions only (the two constructors and imageUrl getters/setter).
…ival - A URL that fails to load now stays failed until the process restarts, as in react-sdk and ios-sdk; the 30 s retry is gone. - MarkerState.icon also reads a counter that goes up when its URL icon's image arrives. The icon is the same instance before and after, so a composition that reads marker.icon (MapTiler and Longdo draw markers as Compose overlays) had no reason to run again. - api: the GroundImageState(imageUrl) constructors moved with the source; the surface is unchanged.
…icon Reading MarkerState.icon also read a Compose counter, and that getter runs 144k times on tile worker threads and in the controllers. The counter is now a separate MarkerState.iconRevision (@InternalMapConductorApi, in its own file so the API record keeps MarkerState); only overlays that draw markers in Compose read it.
This was referenced Nov 6, 2026
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.
ImageIcon(imageUrl, …)andGroundImageState(bounds, imageUrl, …)load their image from a URL. Same design as js-sdk-core and ios-sdk-core.Behaviour
RemoteImageLoader(@InternalMapConductorApi): one fetch per URL onDispatchers.IOwithHttpURLConnection(redirects followed by hand, as inKMLLoader), plus file and data URLs. Up to 32 MB of decoded bitmaps. A failed URL stays failed, logged once. No new dependencies.Drawableone, labels included, plusimageUrl. Transparent at its final size and anchor until the image arrives; labels still draw.hashCode()= URL + parameters + load state, so it changes exactly once.copy()keeps the URL.notifyMutated().MarkerState.iconstays a plain read. A separate@InternalMapConductorApi iconRevision(Compose state) goes up on arrival, for overlays that cache bitmaps in composition (MapTiler, Longdo).imageUrl. A 1 px transparent placeholder until loaded, thenimageis swapped. Results for an older URL are dropped. Settingimagedirectly clearsimageUrl.API
Additions only (
apiCheckpasses).Verification (TB520FU)
RemoteImageDeviceTest6/6; core unit tests 290 pass; ktlint passes.developeven without this change (pre-existing, not addressed here).Companion PRs: android-sdk-compose (GroundImage overload), android-for-maptiler, android-for-longdo.