Change color on a path with a List of GeoPoints
<p>Someone can help me on this?..thank you in advance guys!..</p>

<p>This is the problem: in my RoutePathOverlay class I need to modify it to convert it into like this. This is for Traffic purposes. I have a mode on every point that has a traffic. 
For Example <strong>mode = 1</strong> it is the default color <strong>(green)</strong>, <strong>mode =2</strong> the color is <strong>orange</strong>, <strong>mode = 3</strong> it is color <strong>RED</strong> .. How to modify it this class guys?.</p>

<pre><code>public class RoutePathOverlay extends Overlay {

private int _pathColor;
private final List&lt;GeoPoint&gt; _points;
private boolean _drawStartEnd;

public RoutePathOverlay(List&lt;GeoPoint&gt; points) {


        this(points, Color.GREEN, true);

}

public RoutePathOverlay(List&lt;GeoPoint&gt; points, int pathColor, boolean drawStartEnd) {
        _points = points;
        _pathColor = pathColor;
        _drawStartEnd = drawStartEnd;
}


private void drawOval(Canvas canvas, Paint paint, Point point) {
        Paint ovalPaint = new Paint(paint);
        ovalPaint.setStyle(Paint.Style.FILL_AND_STROKE);
        ovalPaint.setStrokeWidth(2);
        int _radius = 6;
        RectF oval = new RectF(point.x - _radius, point.y - _radius, point.x + _radius, point.y + _radius);
        canvas.drawOval(oval, ovalPaint);               
}

public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) {
        Projection projection = mapView.getProjection();
        if (shadow == false &amp;&amp; _points != null) {
                Point startPoint = null, endPoint = null;
                Path path = new Path();
                //We are creating the path
                for (int i = 0; i &lt; _points.size(); i++) {
                        GeoPoint gPointA = _points.get(i);
                        Point pointA = new Point();
                        projection.toPixels(gPointA, pointA);
                        if (i == 0) { //This is the start point
                                startPoint = pointA;
                                path.moveTo(pointA.x, pointA.y);
                        } else {
                                if (i == _points.size() - 1)//This is the end point
                                        endPoint = pointA;
                                path.lineTo(pointA.x, pointA.y);
                        }
                }

                Paint paint = new Paint();
                paint.setAntiAlias(true);
                paint.setColor(_pathColor);
                paint.setStyle(Paint.Style.STROKE);
                paint.setStrokeWidth(5);
                paint.setAlpha(90);
                if (getDrawStartEnd()) {
                        if (startPoint != null) {
                                drawOval(canvas, paint, startPoint);
                        }
                        if (endPoint != null) {
                                drawOval(canvas, paint, endPoint);
                        }
                }
                if (!path.isEmpty())
                        canvas.drawPath(path, paint);
        }
        return super.draw(canvas, mapView, shadow, when);
}

public boolean getDrawStartEnd() {
        return _drawStartEnd;
}

public void setDrawStartEnd(boolean markStartEnd) {
        _drawStartEnd = markStartEnd;
}}
</code></pre>

<p>thank you soo much for your answers guys!..:). I will Appreciate it!..:) .. Sorry my Grammar is not that nice..:)</p>
