android-maps-compose
android-maps-compose copied to clipboard
Aync Image loading (Coil) is not working (Loader being cancelled)
Re-opening an issue here as this is still not resolved #385 Please provide any feedback - this is a blocker for us.
PR #538 seems to fix the cancellation issue. At least for me. I hope this helps
thanks for the pointer - hopefully that gets merged soon!
I hope so, this is blocking me too... I already asked at the PR if there's an update. So lets see how long this takes :shipit:
i applied the fix from the PR locally - but works not all the time :/
Are you using clustering? Because I do and it works every time. Even when fresh installing the application where the images are not cached yet and need to be fetched first
@pioPirrung
just tried to replicate in the sample app and it's true - working fine now when using clusters - but using a simple MarkerComposable()
it's still not loading (loader being cancelled)
i reproduced it here in the sample app (BasicMapActivity
)
https://github.com/cwsiteplan/android-maps-compose/pull/1
PR #538 got merged and is available in version 4.4.1
FYI. Initially I thought the PR would fix both, but yes this isn't the case. Only fixes it for Clustering
and MarkerComposable
is still broke and needs to be fixed in another PR
Having same issue, any updates on resolving these??
Seeing this issue as well for MarkerComposable
. Trying to load a Coil AsyncImage
as a map Marker.
Any news on fixing this issue?? Please tell us about any updates
Same issue...
Same issue...
Same issue.
As a workaround, I'm hoisting marker ID and using it as a key to compose both a painter and a MarkerComposable
. Otherwise images get messed up when the map recomposes.
key(markerId) {
val painter = rememberAsyncImagePainter(
ImageRequest.Builder(LocalContext.current)
.data("https://...")
.allowHardware(false)
.build()
)
MarkerComposable(
keys = arrayOf(painter.state),
state = rememberMarkerState(position = LatLng(lat, lng)),
) {
Image(
painter = painter,
contentDescription = null,
)
}
}
Same issue.
As a workaround, I'm hoisting marker ID and using it as a key to compose both a painter and a
MarkerComposable
. Otherwise images get messed up when the map recomposes.key(markerId) { val painter = rememberAsyncImagePainter( ImageRequest.Builder(LocalContext.current) .data("https://...") .allowHardware(false) .build() ) MarkerComposable( keys = arrayOf(painter.state), state = rememberMarkerState(position = LatLng(lat, lng)), ) { Image( painter = painter, contentDescription = null, ) } }
It works with this workaround. Thank you!
But we are still waiting for the fix in the library...