Hi all
I am using google maps in my app. everything works correctly until i open the map again.
Here the code i use to open the map when i click on a button:
And this is the remaining code for let it working:
Well if i click on the button for opening the maps everything is working correctly and the circle is added on maps when i tap on maps.
If i click again on the button, the maps displays correctly and i can zoom-in/out but the sub MapInvisibilita_Click is not raised anymore if i tap on the map.
So why happening that?
The situation is back to normal if i close and then open the app. But of course repeating the steps above the problem occours again
Any suggestions?
Thanks in advance!
I am using google maps in my app. everything works correctly until i open the map again.
Here the code i use to open the map when i click on a button:
B4X:
Sub Impostazioni_Button_VisualizzaZoneInvisibilita_Click
FinestreVisualizzate.InsertAt(0,"Impostazioni_ZoneInvisibilita")
ScrollViewPannelloCentrale.Panel.RemoveAllViews '
ScrollViewPannelloCentrale.ScrollToNow(0)
ScrollViewPannelloCentrale.Panel.LoadLayout("Impostazioni_ZoneInvisibilita")
ScrollViewPannelloCentrale.Panel.Height = 100%y-100dip
If Impostazioni_ZoneInvisibilita_Mappe.IsInitialized Then
Impostazioni_ZoneInvisibilita_Mappe.Color=Colors.White
If mFragment_Invisibilita.IsGooglePlayServicesAvailable = False Then
ToastMessageShow("Google Play services not available.", True)
Else
mFragment_Invisibilita.Initialize("MapInvisibilita", Impostazioni_ZoneInvisibilita_Mappe)
End If
End If
End Sub
And this is the remaining code for let it working:
B4X:
Sub MapInvisibilita_Ready
'Log("map ready")
gmap_Invisibilita = mFragment_Invisibilita.GetMap
If gmap_Invisibilita.IsInitialized = False Then
ToastMessageShow("Error initializing map.", True)
Else
gmap_Invisibilita.AddMarker(Latitudine_Invisibilita, Longitudine_Invisibilita, "")
Dim cp As CameraPosition
cp.Initialize(Latitudine_Invisibilita, Longitudine_Invisibilita, 15)
gmap_Invisibilita.MoveCamera(cp)
gmap_Invisibilita.MyLocationEnabled=False
'gmap.AnimateCamera(cp)
End If
End Sub
Sub MapInvisibilita_Click(Point As LatLng)
PuntoInvisibilita = Point
Impostazioni_ZoneInvisibilita_SeekBarRaggio.Enabled = True '
ToastMessageShow("Point: " & Point.Latitude & ", " & Point.Longitude,False)
gmap_Invisibilita.Clear
Dim Acc As Float = 200
Dim GoogleMapsExtras1 As GoogleMapsExtras 'https://www.b4x.com/android/forum/threads/google-maps-android-v2-tutorial.24415/page-3
Dim circle As CircleOptions
circle.Initialize
circle.Center2(Point.Latitude, Point.Longitude)
circle.Radius(Acc)
circle.StrokeWidth(2)
circle.StrokeColor(Colors.ARGB(255,15,157,88))
circle.FillColor(Colors.ARGB(50,15,157,88))
GoogleMapsExtras1.AddCircle(gmap_Invisibilita,circle)
End Sub
Well if i click on the button for opening the maps everything is working correctly and the circle is added on maps when i tap on maps.
If i click again on the button, the maps displays correctly and i can zoom-in/out but the sub MapInvisibilita_Click is not raised anymore if i tap on the map.
So why happening that?
The situation is back to normal if i close and then open the app. But of course repeating the steps above the problem occours again
Any suggestions?
Thanks in advance!