Share via

Xamarin Forms Maps does not visualize polylines

Пaвeл Пaвлoв 1 Reputation point
2021-04-17T07:08:51.287+00:00

When drawing a list of polylines, only the first line is displayed on the map, the rest are colourless, maxLines = 2130903480 is a large number, it is less than 1000 lines. The coordinates are correct. The same result is obtained with Xamarin.GooglePlayServices.Maps

            Polyline pline;
            for (int i = 0; i < cadL[j].ln.Count; i++)                  // List of line
            {
                pline = new Polyline();
                pline.Geopath.Clear();
                pline.StrokeColor = Color.Blue;
                pline.StrokeWidth = 4;

                for (int k = 0; k < cadL[j].ln[i].l.Count; k++)     // List of vertex
                {
                    //pline.Positions.Add(new Position(cadL[j].ln[i].l[k].x, cadL[j].ln[i].l[k].y));
                    pline.Geopath.Add(new Position(cadL[j].ln[i].l[k].x, cadL[j].ln[i].l[k].y));

                }
                customMap.MapElements.Add(pline);
                //customMap.CustomPLines.Add(pline);

            }
Developer technologies | .NET | Xamarin

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.