hi..
I calculate the distance between my own location and another location.
on google maps
how do I calculate between two different points?
thnks..
I calculate the distance between my own location and another location.
on google maps
how do I calculate between two different points?
thnks..
B4X:
..........
line=GoogleMap1.AddPolyline
points.Initialize
line.color=Colors.Red
line.Geodesic=True
line.Visible =True
line.Width=5
pointt.Initialize(GoogleMap1.MyLocation.Latitude, GoogleMap1.MyLocation.Longitude)
points.Add(pointt)
lat1=GoogleMap1.MyLocation.Latitude
lon1=GoogleMap1.MyLocation.Longitude
......
..MapFragment1_Click (Point1 As LatLng)
pointt.Initialize(Point1.Latitude, Point1.Longitude)
points.Add(pointt)
GoogleMap1.AddMarker(Point1.Latitude, Point1.Longitude, "("&Point1.Latitude&", "&Point1.Longitude&")")
lat2=pointt.Latitude
lon2=pointt.Longitude
........
Sub Button1_Click
line.points=points
LocationA.Initialize
LocationA.Latitude = lat1
LocationA.Longitude = lon1
LocationB.Initialize
LocationB.Latitude = lat2
LocationB.Longitude = lon2
Dim distance1 As Float = LocationA.DistanceTo(LocationB)
Label1.Text=distance1
End Sub