16
16
17
17
package com .google .maps .android .clustering .view ;
18
18
19
- import com .google .android .gms .maps .GoogleMap ;
20
- import com .google .android .gms .maps .Projection ;
21
- import com .google .android .gms .maps .model .BitmapDescriptor ;
22
- import com .google .android .gms .maps .model .BitmapDescriptorFactory ;
23
- import com .google .android .gms .maps .model .LatLng ;
24
- import com .google .android .gms .maps .model .LatLngBounds ;
25
- import com .google .android .gms .maps .model .Marker ;
26
- import com .google .android .gms .maps .model .MarkerOptions ;
27
- import com .google .maps .android .R ;
28
- import com .google .maps .android .clustering .Cluster ;
29
- import com .google .maps .android .clustering .ClusterItem ;
30
- import com .google .maps .android .clustering .ClusterManager ;
31
- import com .google .maps .android .collections .MarkerManager ;
32
- import com .google .maps .android .geometry .Point ;
33
- import com .google .maps .android .projection .SphericalMercatorProjection ;
34
- import com .google .maps .android .ui .IconGenerator ;
35
- import com .google .maps .android .ui .SquareTextView ;
36
-
37
19
import android .animation .Animator ;
38
20
import android .animation .AnimatorListenerAdapter ;
39
21
import android .animation .TimeInterpolator ;
55
37
import android .view .ViewGroup ;
56
38
import android .view .animation .DecelerateInterpolator ;
57
39
40
+ import com .google .android .gms .maps .GoogleMap ;
41
+ import com .google .android .gms .maps .Projection ;
42
+ import com .google .android .gms .maps .model .BitmapDescriptor ;
43
+ import com .google .android .gms .maps .model .BitmapDescriptorFactory ;
44
+ import com .google .android .gms .maps .model .LatLng ;
45
+ import com .google .android .gms .maps .model .LatLngBounds ;
46
+ import com .google .android .gms .maps .model .Marker ;
47
+ import com .google .android .gms .maps .model .MarkerOptions ;
48
+ import com .google .maps .android .R ;
49
+ import com .google .maps .android .clustering .Cluster ;
50
+ import com .google .maps .android .clustering .ClusterItem ;
51
+ import com .google .maps .android .clustering .ClusterManager ;
52
+ import com .google .maps .android .collections .MarkerManager ;
53
+ import com .google .maps .android .geometry .Point ;
54
+ import com .google .maps .android .projection .SphericalMercatorProjection ;
55
+ import com .google .maps .android .ui .IconGenerator ;
56
+ import com .google .maps .android .ui .SquareTextView ;
57
+
58
58
import java .util .ArrayList ;
59
59
import java .util .Collections ;
60
60
import java .util .HashMap ;
64
64
import java .util .Queue ;
65
65
import java .util .Set ;
66
66
import java .util .concurrent .ConcurrentHashMap ;
67
- import java .util .concurrent .Executor ;
68
- import java .util .concurrent .Executors ;
69
67
import java .util .concurrent .locks .Condition ;
70
68
import java .util .concurrent .locks .Lock ;
71
69
import java .util .concurrent .locks .ReentrantLock ;
@@ -79,7 +77,6 @@ public class DefaultClusterRenderer<T extends ClusterItem> implements ClusterRen
79
77
private final ClusterManager <T > mClusterManager ;
80
78
private final float mDensity ;
81
79
private boolean mAnimate ;
82
- private final Executor mExecutor = Executors .newSingleThreadExecutor ();
83
80
84
81
private static final int [] BUCKETS = {10 , 20 , 50 , 100 , 200 , 500 , 1000 };
85
82
private ShapeDrawable mColoredCircleBackground ;
@@ -292,7 +289,8 @@ public void run() {
292
289
});
293
290
renderTask .setProjection (projection );
294
291
renderTask .setMapZoom (mMap .getCameraPosition ().zoom );
295
- mExecutor .execute (renderTask );
292
+ // It seems this cannot use a thread pool due to thread locking issues (#660)
293
+ new Thread (renderTask ).start ();
296
294
}
297
295
298
296
public void queue (Set <? extends Cluster <T >> clusters ) {
0 commit comments