touchsquid Active Member Licensed User Longtime User Apr 6, 2022 #1 This code does not work. The pointlist has 4 entries, but as they are added to the poly line points, the log shows the size remains as 0. Code: Course =gmap.AddPolyline For Each px As LatLng In pointlist Course.Points.Add(px) Log(px.Latitude) Log(Course.Points.Size) Next Course.Color = Colors.blue Course.Width =7 This is the code from the B4I GoogleMaps example, which works. Code: pl = gmap.AddPolyline Dim l1, l2, l3, l4 As LatLng l1.Initialize(10, 10) l2.Initialize(10, 20) l3.Initialize(20, 20) l4.Initialize(20, 10) pl.Points = Array(l1, l2, l3, l4, l1) gextra.ZoomToPoints(pl.Points) pl.Width = 5 pl.Color = Colors.Red I tried initialize2, addall as well, and both produce an empty points list. I changed my code to Course.Points = pointlist and it works. This seems like a bug in the library.
This code does not work. The pointlist has 4 entries, but as they are added to the poly line points, the log shows the size remains as 0. Code: Course =gmap.AddPolyline For Each px As LatLng In pointlist Course.Points.Add(px) Log(px.Latitude) Log(Course.Points.Size) Next Course.Color = Colors.blue Course.Width =7 This is the code from the B4I GoogleMaps example, which works. Code: pl = gmap.AddPolyline Dim l1, l2, l3, l4 As LatLng l1.Initialize(10, 10) l2.Initialize(10, 20) l3.Initialize(20, 20) l4.Initialize(20, 10) pl.Points = Array(l1, l2, l3, l4, l1) gextra.ZoomToPoints(pl.Points) pl.Width = 5 pl.Color = Colors.Red I tried initialize2, addall as well, and both produce an empty points list. I changed my code to Course.Points = pointlist and it works. This seems like a bug in the library.
Erel B4X founder Staff member Licensed User Longtime User Apr 7, 2022 #2 touchsquid said: I changed my code to Course.Points = pointlist and it works. This seems like a bug in the library. Click to expand... This is the expected behavior. I will clarify it in the library documentation. Upvote 0
touchsquid said: I changed my code to Course.Points = pointlist and it works. This seems like a bug in the library. Click to expand... This is the expected behavior. I will clarify it in the library documentation.
touchsquid Active Member Licensed User Longtime User Apr 8, 2022 #3 Thanks. Why not remove the add and addall functions? Since they were there, I expected them to work. Anyway thanks. My app is working well now. Upvote 0
Thanks. Why not remove the add and addall functions? Since they were there, I expected them to work. Anyway thanks. My app is working well now.
Erel B4X founder Staff member Licensed User Longtime User Apr 8, 2022 #4 It is not possible to remove them because it returns a regular List object. Upvote 0