Advanced polyline optimized for frequent modifications. Stored as collection of shorter polylines to achieve this.
Inheritance: IDisposable
Example #1
0
 private void AddPolyline(MapPolyline polyline)
 {
     // add the new one
     using (var op = CreatePolylineOptions(polyline))
     {
         foreach (var pt in polyline.Positions)
         {
             op.Add(pt);
         }
         // add the last polyline segment
         var line = PolylineAdv.Add(NativeMap, op);
         _polylines.Add(polyline, line);
     }
 }
Example #2
0
        public static PolylineAdv Add(GoogleMap map, PolylineOptions op)
        {
            var polyline = new PolylineAdv(map, op);
            var idxStart = 0;
            while (idxStart < op.Points.Count)
            {
                using (var options = CloneOptions(op))
                {
                    for (var i = idxStart; i < Math.Min(idxStart + PolylineSegmentLength + 1, op.Points.Count); i++)
                    {
                        options.Add(op.Points[i]);
                    }
                    polyline._polylines.Add(map.AddPolyline(options));
                }

                idxStart += PolylineSegmentLength;
            }

            return polyline;
        }
Example #3
0
        public static PolylineAdv Add(GoogleMap map, PolylineOptions op)
        {
            var polyline = new PolylineAdv(map, op);
            var idxStart = 0;

            while (idxStart < op.Points.Count)
            {
                using (var options = CloneOptions(op))
                {
                    for (var i = idxStart; i < Math.Min(idxStart + PolylineSegmentLength + 1, op.Points.Count); i++)
                    {
                        options.Add(op.Points[i]);
                    }
                    polyline._polylines.Add(map.AddPolyline(options));
                }

                idxStart += PolylineSegmentLength;
            }

            return(polyline);
        }