Android Question Google map is never initialized if used with B4XDrawer (Drawer.CenterPanel.LoadLayout)


Active Member
Licensed User
I am using B4XDrawer and and I load my layout file with the MapFragment on it by using

However, if I do it this way, Google Map is never initialize and I am stuck with a map that has no location.

If I use
then the MapFragment will initialize just fine.

Anyone else have this problem?


Active Member
Licensed User
Can you upload the project? Don't forget to remove your API key.

Here you go Erel:

The upload is "too big" (1MB) to be uploaded.

Thank you

I should mention that I've tried both real device and emulator, in both debug and release mode.
The emulator always has GPS enabled.

If I take away the B4XDrawer part and just have a layout with only Gmap and load it using Activity.Load(""), it will work fine
Last edited:
Upvote 0


B4X founder
Staff member
Licensed User
Longtime User
I took this example:

Change B4XPage_Created to:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Dim drawer As B4XDrawer
    drawer.Initialize(Me, "drawer", Root, 200dip)
    btnJumpToParis.Enabled = False
    Wait For (InitializeMap) Complete (Success As Boolean)
    MapReady = Success
    If MapReady Then
        Log("map ready")
        btnJumpToParis.Enabled = True
        gmap.AddMarker(0, 0, "Center")
    End If
End Sub
It works fine.
Upvote 0