So I’ve given the user controls to use a seekbar to change the radius of a circle overlay object in a MapView.
However, when you drag the seekbar to change the radius of the circle, only the bottom portion of it updates smoothly:

The top half is what the radius of the circle was, and the bottom is where the radius of the circle currently is. The bottom part updates smoothly (along with the progress on the seekbar), but the top remains static for a half second or so.
Ever seen anything like this before? Here is the onDraw method from the RadiusOverlay object I’m using:
public void draw(Canvas canvas, MapView mapView, boolean shadow) {
super.draw(canvas, mapView, shadow);
Point point = new Point();
Projection projection = mapView.getProjection();
projection.toPixels(mGeoPoint, point);
float projectedRadius = projection.metersToEquatorPixels((float)(mRadius * 1609.3d));
Paint paint = new Paint();
paint.setStyle(Paint.Style.FILL);
paint.setARGB(50, 41, 166, 247);
paint.setAntiAlias(true);
canvas.drawCircle((float)point.x, (float)point.y, projectedRadius, paint);
}
Thanks for having a look.
So I added this to the method which draws the circle overlay:
where
mControlleris a LocationController andmLocationOverlayis a LocationOverlay (I guess that was a bit obvious).Anyways adding that line made the circle animate smoothly. It probably as something to do with how overlays work on the map, if they aren’t centered they will clip or something. Who knows. But I tested it again by removing that line and sure enough it clipped again. So I guess that’s the solution. shrugs
If anyone has a real explanation feel free to provide it.