Hi, I need to draw a line between 2 points. I found a snippet but does not work for me.
I appreciate any inputs.
B4X:
Sub LineTest
Dim PointList As List
PointList.Initialize
gmap.Clear
Dim Pt1 As LatLng
Pt1.Initialize(11.2438762,125.0079656)
Dim Pt2 As LatLng
Pt2.Initialize(11.243402, 125.008711)
PointList.Add(Pt1)
PointList.Add(Pt2)
gmap.AddMarker2(Pt1.Latitude,Pt1.Longitude,"Info1",gmap.HUE_MAGENTA)
gmap.AddMarker2(Pt2.Latitude,Pt2.Longitude,"Info2",gmap.HUE_MAGENTA)
Dim sPoly As Polyline = gmap.AddPolyline
sPoly.Points.Add(Pt1)
sPoly.Points.Add(Pt2)
sPoly.Color=Colors.Blue
sPoly.Width = 20dip
Dim LLB As LatLngBoundsBuilder
LLB.Initialize
LLB.Include(Pt1)
LLB.Include(Pt2)
Dim LatLngBounds1 As LatLngBounds = LLB.Build
GoogleMapsExtras1.AnimateToBounds2 (gmap, LatLngBounds1 , Activity.Width,Activity.height, 40)
End Sub
I appreciate any inputs.