# compose

Guy Bieber

06/04/2020, 3:15 AM
Has anyone integrated google maps into a compose app? I am looking for example code if it exists.

John O'Reilly

07/05/2020, 1:38 PM
Did you find any examples of this? I have app that uses
right now and looking to get working with Compose....curious how data source that for example drives placement of markers would be managed.....and likewise where panning of map triggers data query/update
@romainguy I just saw that you mentioned using
AndroidView you know of any examples of this used for a map like this?
I have basic setup working using
with a layout file that includes
fragment ....looking next at what options are for accessing map and tying in for example with map lifecycle callbacks
ok, looks like I can do something like
Copy code
AndroidView(resId = R.layout.fragment_nearby, modifier = Modifier.weight(0.4f)) {
    val mapFragment = fragmentManager.findFragmentById( as SupportMapFragment

    mapFragment.getMapAsync {map ->
        map.isMyLocationEnabled = true
👍 1