Skip to content

Commit

Permalink
Merge pull request #9 from twotoasters/carlton-dev
Browse files Browse the repository at this point in the history
Proofread readme, address Google Play Sample app crash reports
  • Loading branch information
Carlton Whitehead committed May 2, 2013
2 parents 86ada41 + 95eee96 commit 5e5c20e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class YourMapPointModel {
}
```

Clusterkraf provides an `InputPoint` class which holds a `LatLng` position and an `Object` tag. You just need to construct an `ArrayList<InputPoint>` object based on your model objects similar to this example. In this example, we provide the model as the `Object` tag for the `InputPoint` so that we can later access it callbacks; see `MarkerOptionsChooser`, `OnInfoWindowClickDownstreamListener`, and `OnMarkerClickDownstreamListener`.
Clusterkraf provides an `InputPoint` class which holds a `LatLng` position and an `Object` tag. You just need to construct an `ArrayList<InputPoint>` object based on your model objects similar to this example. In this example, we provide the model as the `Object` tag for the `InputPoint` so that we can later pass them back to you in callbacks as the `ClusterPoint` object's pointsInCluster list; see `MarkerOptionsChooser`, `OnInfoWindowClickDownstreamListener`, and `OnMarkerClickDownstreamListener`.

```java
public class YourActivity extends FragmentActivity {
Expand Down Expand Up @@ -64,7 +64,7 @@ The sample app demonstrates Activity lifecycle, custom marker icons, click handl

### Building the Sample App

1. in your local checkout of the Clusterkraf git repo, do `git submodule init` and `git submodule update`.
1. In your local checkout of the Clusterkraf git repo, do `git submodule init` and `git submodule update`.
2. Add sample/ as a new Android project from existing source.
3. Add sample/libs/ViewPagerIndicator as a new Android project from existing source.
4. Authorize com.twotoasters.clusterkraf.sample built with your key of choice to your Google Maps for Android v2 API account.
Expand Down
15 changes: 15 additions & 0 deletions library/src/com/twotoasters/clusterkraf/Clusterkraf.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,21 @@ public void replace(ArrayList<InputPoint> inputPoints) {
* Remove all Clusterkraf-managed markers from the map
*/
public void clear() {
/**
* cancel the background thread clustering task
*/
if (clusteringTaskHost != null) {
clusteringTaskHost.cancel();
clusteringTaskHost = null;
}
/**
* cancel the background thread transition building task
*/
if (clusterTransitionsBuildingTaskHost != null) {
clusterTransitionsBuildingTaskHost.cancel();
clusterTransitionsBuildingTaskHost = null;
}

/**
* we avoid GoogleMap.clear() so users can manage their own
* non-clustered markers on the map.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private Bitmap getClusterBitmap(Resources res, int resourceId, int clusterSize)
}
Bitmap bitmap = BitmapFactory.decodeResource(res, resourceId, options);
if (bitmap.isMutable() == false) {
bitmap = bitmap.copy(bitmap.getConfig(), true);
bitmap = bitmap.copy(Bitmap.Config.ARGB_8888, true);
}

Canvas canvas = new Canvas(bitmap);
Expand Down

0 comments on commit 5e5c20e

Please sign in to comment.