Ejemplo n.º 1
0
        //only works if parts are in correct order
        public static Polyline drawPolyLine3(DBObjectCollection dbObjCol)
        {
            Polyline pLine = new Polyline();
            PolylineSegmentCollection collection = new PolylineSegmentCollection();

            foreach (DBObject dbo in dbObjCol)
            {
                //convert part to polyline
                if (dbo is Arc)
                {
                    Arc             arcDat = dbo as Arc;
                    double          bulge  = getArcBulge(arcDat.EndAngle, arcDat.StartAngle);
                    PolylineSegment pSeg   = new PolylineSegment(new Point2d(arcDat.StartPoint.X, arcDat.StartPoint.Y), new Point2d(arcDat.EndPoint.X, arcDat.EndPoint.Y), bulge);
                    collection.Add(pSeg);
                }
                else if (dbo is Line)
                {
                    Line            lDat = dbo as Line;
                    PolylineSegment pSeg = new PolylineSegment(new Point2d(lDat.StartPoint.X, lDat.StartPoint.Y), new Point2d(lDat.EndPoint.X, lDat.EndPoint.Y));
                    //add to collection
                    collection.Add(pSeg);
                }
            }
            //convert Collection to polyline
            collection.Join();
            pLine = collection.ToPolyline();
            return(pLine);
        }
Ejemplo n.º 2
0
        private void DrawPolylineSegment(PolylineSegment polylineSegment, int colorInt)
        {
            var polylineOptions = new PolylineOptions();

            polylineOptions.InvokeColor(colorInt);

            polylineOptions.Add(new LatLng(polylineSegment.SnappedPointStart.Position.Latitude, polylineSegment.SnappedPointStart.Position.Longitude));
            polylineOptions.Add(new LatLng(polylineSegment.SnappedPointEnd.Position.Latitude, polylineSegment.SnappedPointEnd.Position.Longitude));

            NativeMap.AddPolyline(polylineOptions);
        }