Pravee7094
Active Member
Hi all,
I used the below code to get the latitude and longitude of current location and automatically zoom to the current location. It works perfectly.
But I want to Click the one button (Get current location) and it get latitude and longitude values and automatically zoom to the current location. In here
I tried but does not find the solution
Anybody Help?
Thanks
praveen
I used the below code to get the latitude and longitude of current location and automatically zoom to the current location. It works perfectly.
B4X:
'starter
Sub GPS_LocationChanged (Location1 As Location)
If Timer1.Enabled = True Then
CallSub2(activity, "LocationChanged", Location1)
End If
End Sub
B4X:
'activity
Sub LocationChanged(Location1 As Location)
Log("Latitude : " & Location1.Latitude)
Log("Longitude : " & Location1.Longitude)
Dim cp As CameraPosition
cp.Initialize(Location1.Latitude, Location1.Longitude, 17)
ig_googlemap.AnimateCamera(cp)
End Sub
But I want to Click the one button (Get current location) and it get latitude and longitude values and automatically zoom to the current location. In here
B4X:
Sub ipbtn_currentlocaiton_Click
End Sub
Anybody Help?
Thanks
praveen