Android dynamically changes the size of the circle, only half the circle updates correctly

So, I let the user controls use a breaker to change the radius of the circle overlay object in MapView.

However, when you drag the arrow to change the radius of the circle, only the bottom of it is smoothly updated:

WRONG

The upper half is the radius of the circle, and the bottom is the radius of the circle. The lower part is smoothly updated (along with progress on the search bar), but the upper part remains static for half a second or so.

Ever seen anything like this before? Here is the onDraw method from the RadiusOverlay object that I am 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 watching.

+5
source share
1 answer

, , :

mController.animateTo(mLocationOverlay.getMyLocation());

mController - LocationController, mLocationOverlay - LocationOverlay ( , ).

, , . , - , , , - . . , , , . , .

, .

+3

All Articles