GoogleMap thing still unsolved but it is not Permissions.
---------------------------------------------------------------
As near as I can tell, through trial-and-error slogging, none of the map API stuff works without pleading for PERMISSION_ACCESS_FINE_LOCATION.
It is unusual for me to want something a little odd, but I want to use GoogleMaps "everything", but I do not care about the device's location. I especially do not want to ask the user's permission for anything whatsoever (after PlayStore Install button).
I want to pump a latitude and longitude to gMaps, then let the Goog do its thing. (no WebView stuff please)
I have used this example many times in the past:
https://www.b4x.com/android/forum/threads/b4x-b4xpages-googlemaps-example.120121/#content
Without permission, app blows up at "Wait For gMap_Ready"
Snippet from log (broke App again for you guys):
Some MapFragment is pissed. No idea what anything else means.
---------------------------------------------------------------
As near as I can tell, through trial-and-error slogging, none of the map API stuff works without pleading for PERMISSION_ACCESS_FINE_LOCATION.
It is unusual for me to want something a little odd, but I want to use GoogleMaps "everything", but I do not care about the device's location. I especially do not want to ask the user's permission for anything whatsoever (after PlayStore Install button).
I want to pump a latitude and longitude to gMaps, then let the Goog do its thing. (no WebView stuff please)
I have used this example many times in the past:
https://www.b4x.com/android/forum/threads/b4x-b4xpages-googlemaps-example.120121/#content
Without permission, app blows up at "Wait For gMap_Ready"
B4X:
Private Sub InitializeMap As ResumableSub
LogSub("InitializeMap")
#if B4J
gmap.Initialize2("gmap", Null, Main.API_KEY)
pnlMap.AddView(gmap.AsPane, 0, 0, pnlMap.Width, pnlMap.Height)
Wait For gmap_Ready
Return gmap.IsReady
#Else If B4i
gmap.Initialize("gmap", Main.API_KEY)
pnlMap.AddView(gmap, 0, 0, pnlMap.Width, pnlMap.Height)
gmap.GetUiSettings.CompassEnabled = True
gmap.GetUiSettings.MyLocationButtonEnabled = True
gmap.MyLocationEnabled = True
Return True
#Else if B4A
Wait For gMap_Ready
gMap = gMapFragment.GetMap
If gMap.IsInitialized Then
'' Log("gmap.IsInitialized")
gMap.MyLocationEnabled = True
End If
Return gMap.IsInitialized
#End If
End Sub
Snippet from log (broke App again for you guys):
B4X:
B4Silly 08:02:27:528 DisplayGMap: 45.53122329711914 / -122.68580627441406
mGMap 08:02:27 Initialize: mgmap1
mGMap 08:02:27 DesignerCreateView
mGMap 08:02:27 DisplayGMap: 45.53122329711914 / -122.68580627441406
mGMap 08:02:27 InitializeMap
java.lang.IllegalArgumentException: No view found for id 0x2711 (unknown) for fragment MapFragment{77168fa #0 id=0x2711}
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1297)
at android.app.FragmentManagerImpl.addAddedFragments(FragmentManager.java:2431)
at android.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2210)
at android.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2166)
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2067)
at android.app.FragmentManagerImpl$1.run(FragmentManager.java:742)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Some MapFragment is pissed. No idea what anything else means.
Last edited: