I am implementing a way to show a search radius on a Google Map (v2) in Android per this method:
// Method for drawing a circle around the user
private void drawMapSearchRadius(int radius) {
if(mMap != null) {
final LatLng userLatLng = getUserLatLng();
if(mSearchCircle == null){
CircleOptions circleOptions = new CircleOptions();
circleOptions.fillColor(Color.parseColor("#447755ff"));
circleOptions.strokeColor(Color.TRANSPARENT);
circleOptions.center(userLatLng);
circleOptions.radius(radius);
mSearchCircle = mMap.addCircle(circleOptions);
} else {
mSearchCircle.setCenter(userLatLng);
mSearchCircle.setRadius(radius);
}
}
}
The radius is determined with a SeekBar, like so (I removed some unrelated code):
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
final int radius = progress + DEFAULT_MIN_RADIUS;
drawMapSearchRadius(radius);
...
When I slide the SeekBar, the radius of the circle changes as expected, but it is visibly flickering a lot. It looks and feels just very bad.
Did anyone experience this error and could tell me what I did wrong or what I could do better to limit or, in the best case, eliminate the circle flickering?
Thanks in advance
EDIT: Apparently it's a bug existing for over a year already, acknowledged by Google last month.
Since Google is not known for fixing errors like this quickly, I have very little hope for a fix.. So I guess my question is changing to this: Are there any workarounds for the meantime?
This issue (5707) has been solved on October 24, 2016
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