Does anyone know how to set the width of a line for a PathOverlay element in OSMDroid?
The PathOverlay class itself doesn't really have anything useful in that arena. I've trying going into the Paint and Canvas used by PathOverlay's draw method. The android.graphics.Paint class has a setStrokeWidth(float) method, but that has no effect on the line width.
Looking through the Paint API, there isn't much else there that helps; likewise for the Canvas.
Try the following (you can adapt to your requirements);
pathOverlay = new PathOverlay(Color.GREEN, context);
ArrayList<GeoPoint> path = getTrackPoints();
mMapView.getOverlays().add(pathOverlay);
Paint pPaint = pathOverlay.getPaint();
pPaint.setStrokeWidth(5);
pathOverlay.setPaint(pPaint);
If you get the Paint settings from the overlay and then just modify the width it solves having to worry about other Paint settings
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With