My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 5707: Bug: Circle filling flickers on fast circle radius and center update
75 people starred this issue and may be notified of changes. Back to list
Status:  Acknowledged
Owner:  ----


Sign in to add a comment
 
Reported by [email protected], Aug 9, 2013
On fast Circle (with filling and stroke) updating (~10ms) filling flickers on center and radius change. Stroke is drawn fine.


What steps will reproduce the problem? Please provide a link to a
demonstration page if at all possible, or attach code.
1. Create Circle with some center and radius.
2. Update Circle radius and center (by a little bit) in any repeatable timer with refresh delay ~10ms.
3. Look at circle filling flickering.

*********************************************************
For developers viewing this issue: please click the 'star' icon to be
notified of future changes, and to let us know how many of you are
interested in seeing it resolved.
*********************************************************

Aug 26, 2013
#1 [email protected]
This source code will show the problem:

import com.google.android.gms.maps.model.Circle;
import com.google.android.gms.maps.model.CircleOptions;
import com.google.android.gms.maps.model.LatLng;

    Circle circle;
	
	public void init(){
		....
		circle = myMap.addCircle(getCircleOptions(latlng,radius));
		animateCircle();
	}
	
    public CircleOptions getCircleOptions(LatLng latlng, int radius) {
        CircleOptions co = new CircleOptions();
        int color = Color.argb(30, 255, 0, 0);
        co.center(latlng);
        co.radius(radius);
        co.fillColor(color);
        co.strokeColor(color);
        co.strokeWidth(0.0f);
        return co;
    }	
	
	public void animateCircle(){
    	ValueAnimator vAnimator = ValueAnimator.ofInt(85,100);
        vAnimator.setRepeatCount(ValueAnimator.INFINITE);
        vAnimator.setRepeatMode(ValueAnimator.REVERSE);
        vAnimator.setEvaluator(new IntEvaluator());
        vAnimator.setDuration(300);

        vAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
        vAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator valueAnimator) {
            	int animatedValue = (Integer)valueAnimator.getAnimatedValue();
            		circle.setRadius(animatedValue);
            }
        });
        vAnimator.start();    	
    }
Sep 9, 2013
#2 [email protected]
I'm seeing the same bug with updates way slower than 10ms.

From my experience, the update speed is not the issue. Moving or resizing the circle just very slightly appears to be what's triggering the bug. Bigger adjustments render fine, regardless of update frequency.
Nov 7, 2013
#3 [email protected]
I'm trying to have the user control the circle with a slider and I'm suffering with the same flicker / redraw issues.

The issue still exists on the latest Google Play Services and KitKat.

Unfortunately, based on past experience with these sorts of bugs, I have very little faith this will see a fix any time soon.

What are folks doing for a work-around?

I imagine one could use a drawable circle for the animation and replace it with a Map's Circle when the animation finishes?
Dec 2, 2013
#4 [email protected]
Like Rick, I am using a slider to change the circle radius. The fill of the circle flickers as the radius is change.
Feb 7, 2014
#5 camueller28
Event at a rate of 1 change per second most of the times the circle is not filled and only sometimes it is filled. With debugging active the circle is filled always. This seems to be a timing issue.
Feb 7, 2014
#6 [email protected]
camueller28, what do you mean with debugging active? I have debugging Log.d calls in my app and I'm still seeing the issue.
Feb 7, 2014
#7 camueller28
Sorry, I should have explained that better. With debugging active I mean the debugger of the IDE attached to the app. This slows down execution of the app significantly. One of the rare cases where results get better when slowed down ;)
Apr 7, 2014
#8 [email protected]
My circle fills sometimes don't fill even without changing the radius. Simply zooming in and out will cause some/all not to be filled quite randomly. 

This person here is having the same issue with polygons. http://stackoverflow.com/questions/20068178/android-maps-v2-polygon-fill-disappears-when-zooming-out

I can also confirm with Eclipse debugger attached that the fills are always drawn.
May 21, 2014
#9 [email protected]
The problem even occurs within the CircleDemoActivity of the Google Maps API Demos!
Sep 18, 2014
Project Member #10 [email protected]
(No comment was entered for this change.)
Status: Acknowledged
Labels: Internal-17575814
Apr 8, 2015
#11 [email protected]
This error still persists, is there any hope for a fix soon?
Apr 17, 2015
#12 [email protected]
So, more than 1 year and a half, and still no update on this one ?
It makes the creation of a custom MyLocation marker impossible :/ ...

I have the same problem with polygons too.
May 11, 2015
#13 [email protected]
for those using seekbar to update the radius of said circle.. I used onStartTrackingTouch to put the fill to transparent and then set the fill color back onStopTrackingTouch. The stroke color doesn't flicker and it gives a nice enough effect without having the fill color flicker.. just a tip untill they solve this issue.
May 11, 2015
#14 [email protected]
As a workaround, you can manually draw and overlay the circle using a canvas. Just use the map's projection, which you can use to turn LatLng's to screen location and position the circle appropriately.

If you're having trouble sizing the circle, you can get a screen:map distance ratio by dividing the measured width of the map by the distance between the two lower points of the visible region (which you can also get from the projection object).

Just keep it updated by hooking a function that updates your circle's center and radius up to an OnCameraChangeListener.
Jan 4, 2016
#15 [email protected]
I'm still seeing this behavior in 2016.
Mar 8, 2016
#17 [email protected]
@Gigs Could you post some code regarding your canvas workaround?
Apr 6, 2016
#18 [email protected]
The problem still occur. Is it possible to fix it soon?
May 12, 2016
#19 [email protected]
Guys, the problem still occurs. Almost 3 years since first report. It's not funny. 
Sign in to add a comment

Powered by Google Project Hosting