private void DrawPath(ShapePaintContainer shapePaintContainer, Point[][] coordinates, float dy)
        {
            this.path.Clear();

            foreach (Point[] innerList in coordinates)
            {
                Point[] points;
                if (dy != 0f)
                {
                    points = RendererUtils.ParallelPath(innerList, dy);
                }
                else
                {
                    points = innerList;
                }
                if (points.Length >= 2)
                {
                    Point point = points[0];
                    this.path.MoveTo((float)point.X, (float)point.Y);
                    for (int i = 1; i < points.Length; ++i)
                    {
                        point = points[i];
                        this.path.LineTo((int)point.X, (int)point.Y);
                    }
                }
            }

            this.canvas.DrawPath(this.path, shapePaintContainer.paint);
        }
        private void DrawCircleContainer(ShapePaintContainer shapePaintContainer)
        {
            CircleContainer circleContainer = (CircleContainer)shapePaintContainer.shapeContainer;
            Point           point           = circleContainer.point;

            this.canvas.DrawCircle((int)point.X, (int)point.Y, (int)circleContainer.radius, shapePaintContainer.paint);
        }
        private void DrawShapePaintContainer(ShapePaintContainer shapePaintContainer)
        {
            ShapeType shapeType = shapePaintContainer.shapeContainer.ShapeType;

            switch (shapeType)
            {
            case org.mapsforge.map.layer.renderer.ShapeType.CIRCLE:
                DrawCircleContainer(shapePaintContainer);
                return;

            case org.mapsforge.map.layer.renderer.ShapeType.POLYLINE:
                PolylineContainer polylineContainer = (PolylineContainer)shapePaintContainer.shapeContainer;
                DrawPath(shapePaintContainer, polylineContainer.CoordinatesRelativeToTile, shapePaintContainer.dy);
                return;
            }
        }
Example #4
0
        private void DrawPath(ShapePaintContainer shapePaintContainer, Point[][] coordinates, float dy)
        {
            if (canvas == null)
            {
                return;
            }

            // TODO
            //this.path.Clear();
            var path = this.graphicFactory.CreatePath();

            foreach (Point[] innerList in coordinates)
            {
                Point[] points;
                if (dy != 0f)
                {
                    points = RendererUtils.ParallelPath(innerList, dy);
                }
                else
                {
                    points = innerList;
                }
                if (points.Length >= 2)
                {
                    Point point = points[0];
                    path.MoveTo((float)point.X, (float)point.Y);
                    for (int i = 1; i < points.Length; ++i)
                    {
                        point = points[i];
                        path.LineTo((int)point.X, (int)point.Y);
                    }
                }
            }

            this.canvas.DrawPath(path, shapePaintContainer.paint);
        }