I migrated from version 6.50 to 10.2
I'm now testing new Google Maps API.
I've got this problem:
I always get an error in the log window:
Object should first be intialized
when I try to animate camera:
It happens when I try to use gmpa.MyLocation.Latitude for the first time
and even calling Cpos.Initialize
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
Wait For MapFragment1_Ready
gmap = MapFragment1.GetMap
gmap.MapType=1
rp.CheckAndRequest(rp.PERMISSION_ACCESS_FINE_LOCATION)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
If Result Then
gmap.MyLocationEnabled = True
Do While gmap.IsInitialized = False
Log("...")
Loop
Log("Pre LAT --> " & gmap.MyLocation.Latitude)
Log("Pre LON --> " & gmap.MyLocation.Longitude)
Dim Cpos As CameraPosition
Cpos.Initialize(gmap.MyLocation.Latitude,gmap.MyLocation.Longitude, 17)
Log("LAT --> " & gmap.MyLocation.Latitude)
Log("LON --> " & gmap.MyLocation.Longitude)
Do While Cpos.IsInitialized = False
Log("2...")
Loop
gmap.AnimateCamera(Cpos)
Else
Log("Autorizzazione negata!")
End If
End Sub
Anyway, despite of the error, stepping in debug works, the position is correct and CameraAnimate works.
If I press F10 in the IDE, the program crashes as it does in release mode.
I tried to test for initialization with no success.
Any suggestions?