B4X:
Sub LineTest
'Dim gmap As GoogleMap (in globals
'Wait For Gmap1_Ready (in activity_create
'gmap = Gmap1.GetMap
Dim GME As GoogleMapsExtras
gmap.Clear
Dim Pt1 As LatLng
Pt1.Initialize(49.3,-123.5)
Dim Pt2 As LatLng
Pt2.Initialize(49.5,-123.0)
gmap.AddMarker2(Pt1.Latitude,Pt1.Longitude,"Test1",gmap.HUE_GREEN)
gmap.AddMarker2(Pt2.Latitude,Pt2.Longitude,"Test2",gmap.HUE_GREEN)
Dim SL As PolylineOptions
SL.Initialize
SL.Add(Pt1)
SL.Add(Pt2)
Dim sPoly As Polyline =GME.AddPolyline(gmap, SL)
sPoly.Color=gmap.HUE_GREEN
sPoly.Width = 15dip
Dim LLB As LatLngBoundsBuilder
LLB.Initialize
LLB.Include(Pt1)
LLB.Include(Pt2)
Dim LatLngBounds1 As LatLngBounds = LLB.Build
GME.AnimateToBounds2 (gmap, LatLngBounds1 , Activity.Width,Activity.height, 50)
End Sub
The above code compiles and runs without error. The Markers appear on the map and it zooms and pans to the area. BUT, the polyline does not show. This is a subset of a longer path I have tried to draw with no results. Is there some special permission to draw lines?
Otherwise the map is working fine. I have examined other code in the forum and tried several variations but nothing draws a visible line.
Any help is greatly appreciated.