googlemaps / googlemaps/android-maps-compose
Compose GoogleMap without jank
- Dominant language
- Kotlin
- Stars
- 1.3k
- Forks
- 181
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 18
Description
Adding GoogleMap to the composition causes huge amounts of jank. The UI thread can be blocked on the order of seconds.
When incorporating MapView via AndroidView directly, a developer has some control and flexibility about working around MapView's jank issues upon initialization/loading. When incorporating GoogleMap via android-maps-compose, the library should offer options to reign in jank; I as a developer have less control over mitigating jank directly. Otherwise please point out jank mitigation strategies.
My jankiest use case displays GoogleMap in an accompanist HorizontalPager. Once GoogleMap enters the composition the pager stops in the middle of flipping through pages, for one or two seconds on emulator. The best mitigation I have found so far displays a "Loading...." page initially and waits with adding GoogleMap to the composition until the "Loading...." page is displayed with 0 horizontallOffset, meaning the user stopped flipping through pages to patiently stare at the "Loading...." screen. It sounds ridiculous, because it is. However, this way the jank is largely obscured.
Contributor guide
Assessment
This issue has not been assessed yet.