https://kotlinlang.org logo
#compose
Title
# compose
c

Colton Idle

04/25/2022, 4:27 AM
More of a discussion/question for folks that have used Google Maps Compose Library. I'm starting on a new project, and we're going to be 100% compose, but a big feature of our project is a map view. I've never worked with maps before, and I'm curious to hear if anyone has used it before and found any issues or any missing apis. Or is it pretty much a 1:1 drop in replacement for the view-based google maps library?
f

FunkyMuse

04/25/2022, 8:18 AM
I've used it for a pet project and it was okay until i had to add a window info adapter and was stopped by https://github.com/googlemaps/android-maps-compose/issues/46 The pet project is somewhat a rewrite of an app i had, having 4 screens with maps and each of them handles from 20.000 - 50.000 markers with custom info window UI and pins Also it's missing cluster manager which is crucial for that amount of info https://github.com/googlemaps/android-maps-compose/issues/44 So I postponed the migration for now and would definitely use an Android view and handle things manually like I would in a fragment for now at least
n

nitrog42

04/25/2022, 11:57 AM
I also fiddled with the Maps Compose ; the issue with the cluster manager missing is not that we don't have "visual" clusters on the map, but rather we can't display a high number of markers without having a big freeze (even with compose, we have to iterate on a list of +1000 elements and create a node for each, then the render starts to fall and freeze when the composition is complete)
basically if you don't need a high marker count rendered, and won't have any of the things listed here needed : https://github.com/googlemaps/android-maps-compose/issues you should be good to go
a trick that can be used for the high markers count is to only display a small numbers (based on the current viewport for example), or do some kind of clustering but on the compose side
c

Colton Idle

04/25/2022, 1:51 PM
Gotcha. I will definitely have a high marker count. So I won't use this for now. I guess I can just put a regular maps view into AndroidView and still use it in my fully compose app?
n

nitrog42

04/25/2022, 1:54 PM
you definitelly can but it's a bit hacky
c

Colton Idle

04/25/2022, 1:54 PM
damn. okay. back to the drawing board.
we definitelly got it working on our apps, it's just that it's hard to make this block "clean" with many features :
but we implemented clustering, some camera follow of the user position etc... I'd show the code if I could 😕
c

Colton Idle

04/25/2022, 1:59 PM
Thanks! Yeah. I tseems like I just need a map with clustering support, and then basically being able to "click" on these pins individually. I'm new to Google Maps, and so I'm super limited in my knowledge with it. but cool
Glad to know someone that has done this! I might reach out directly in the coming weeks/months if you don't mind if I start banging my head against a wall. The google maps api has me nervous. lol. I'm glad I didn't just start with maps compose. Thank you all!
n

nitrog42

04/25/2022, 2:00 PM
no problem
by the way, if you start this in the coming weeks/months I have (probably false) hopes that the clustering will be available by then
c

Colton Idle

04/25/2022, 3:58 PM
yeah. i need this done by end of may... so its something i probably wont hold out on. lol
3 Views