Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

setRadius on Circle gives bad user experience in Google Maps

I'm trying to implement something like in Google Maps samples and their CircleDemoActivity:

Android Samples

The problem is that, the circle is disappearing and appearing, and I recorded that problem

Google Maps Sample problem

In my opinion that part should work:

if (marker.equals(radiusMarker)) {
    radius = toRadiusMeters(centerMarker.getPosition(), radiusMarker.getPosition());
    circle.setRadius(radius);
    return true;
}

and the problem is with setRadius method, but maybe is some workaround.

Question

How to fix that?

like image 983
Nominalista Avatar asked Apr 29 '16 07:04

Nominalista


1 Answers

Few months ago I had to implement an animation of a circle growing and shrinking to under a marker to inform our user that the marker location was not precisely known.

In a first implementation I used a circle and had the same issue. I ended up using a GroundOverlay with a circle image and it does not blink. It may just require more maths to get the correct radius.

I hope it could help :)

like image 139
acidflow Avatar answered Oct 20 '22 00:10

acidflow