diff --git a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/MarkerManager.java b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/MarkerManager.java
index 44d4dfedc..24ac20a20 100755
--- a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/MarkerManager.java
+++ b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/MarkerManager.java
@@ -21,7 +21,9 @@
*
* Inspired by https://github.com/googlemaps/android-maps-utils.
*
+ * @deprecated use runtime styling to cluster markers instead
*/
+@Deprecated
public class MarkerManager implements MapboxMap.OnInfoWindowClickListener, MapboxMap.OnMarkerClickListener,
MapboxMap.InfoWindowAdapter {
@@ -30,10 +32,12 @@ public class MarkerManager implements MapboxMap.OnInfoWindowClickListener, Mapbo
private final Map mNamedCollections = new HashMap();
private final Map mAllMarkers = new HashMap();
+ @Deprecated
public MarkerManager(MapboxMap map) {
this.mMap = map;
}
+ @Deprecated
public Collection newCollection() {
return new Collection();
}
@@ -42,7 +46,9 @@ public Collection newCollection() {
* Create a new named collection, which can later be looked up by {@link #getCollection(String)}
*
* @param id a unique id for this collection.
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public Collection newCollection(String id) {
if (mNamedCollections.get(id) != null) {
throw new IllegalArgumentException("collection id is not unique: " + id);
@@ -56,11 +62,14 @@ public Collection newCollection(String id) {
* Gets a named collection that was created by {@link #newCollection(String)}
*
* @param id the unique id for this collection.
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public Collection getCollection(String id) {
return mNamedCollections.get(id);
}
+ @Deprecated
@Override
public View getInfoWindow(Marker marker) {
Collection collection = mAllMarkers.get(marker);
@@ -70,6 +79,7 @@ public View getInfoWindow(Marker marker) {
return null;
}
+ @Deprecated
@Override
public boolean onInfoWindowClick(Marker marker) {
Collection collection = mAllMarkers.get(marker);
@@ -79,6 +89,7 @@ public boolean onInfoWindowClick(Marker marker) {
return true;
}
+ @Deprecated
@Override
public boolean onMarkerClick(Marker marker) {
Collection collection = mAllMarkers.get(marker);
@@ -93,12 +104,15 @@ public boolean onMarkerClick(Marker marker) {
*
* @param marker the marker to remove.
* @return true if the marker was removed.
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public boolean remove(Marker marker) {
Collection collection = mAllMarkers.get(marker);
return collection != null && collection.remove(marker);
}
+ @Deprecated
public class Collection {
private final Set mMarkers = new HashSet();
private MapboxMap.OnInfoWindowClickListener mInfoWindowClickListener;
@@ -106,9 +120,11 @@ public class Collection {
// private MapboxMap.OnMarkerDragListener mMarkerDragListener;
private MapboxMap.InfoWindowAdapter mInfoWindowAdapter;
+ @Deprecated
public Collection() {
}
+ @Deprecated
public Marker addMarker(MarkerOptions opts) {
Marker marker = mMap.addMarker(opts);
mMarkers.add(marker);
@@ -116,6 +132,7 @@ public Marker addMarker(MarkerOptions opts) {
return marker;
}
+ @Deprecated
public boolean remove(Marker marker) {
if (mMarkers.remove(marker)) {
mAllMarkers.remove(marker);
@@ -125,6 +142,7 @@ public boolean remove(Marker marker) {
return false;
}
+ @Deprecated
public void clear() {
for (Marker marker : mMarkers) {
marker.remove();
@@ -133,18 +151,22 @@ public void clear() {
mMarkers.clear();
}
+ @Deprecated
public java.util.Collection getMarkers() {
return Collections.unmodifiableCollection(mMarkers);
}
+ @Deprecated
public void setOnInfoWindowClickListener(MapboxMap.OnInfoWindowClickListener infoWindowClickListener) {
mInfoWindowClickListener = infoWindowClickListener;
}
+ @Deprecated
public void setOnMarkerClickListener(MapboxMap.OnMarkerClickListener markerClickListener) {
mMarkerClickListener = markerClickListener;
}
+ @Deprecated
public void setOnInfoWindowAdapter(MapboxMap.InfoWindowAdapter infoWindowAdapter) {
mInfoWindowAdapter = infoWindowAdapter;
}
diff --git a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/Cluster.java b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/Cluster.java
index 0f13eb95e..947d13289 100755
--- a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/Cluster.java
+++ b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/Cluster.java
@@ -9,7 +9,10 @@
*
* Inspired by https://github.com/googlemaps/android-maps-utils.
*
+ *
+ * @deprecated use runtime styling to cluster markers instead
*/
+@Deprecated
public interface Cluster {
public LatLng getPosition();
diff --git a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/ClusterItem.java b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/ClusterItem.java
index fffc0178e..5edd68fa8 100755
--- a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/ClusterItem.java
+++ b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/ClusterItem.java
@@ -7,7 +7,10 @@
*
* Inspired by https://github.com/googlemaps/android-maps-utils.
*
+ *
+ * @deprecated use runtime styling to cluster markers instead
*/
+@Deprecated
public interface ClusterItem {
/**
diff --git a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/ClusterManagerPlugin.java b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/ClusterManagerPlugin.java
index 31e2160b1..bfe0454ca 100755
--- a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/ClusterManagerPlugin.java
+++ b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/ClusterManagerPlugin.java
@@ -32,7 +32,10 @@
* for clustering functionality at the core level,
* please follow the work on https://github.com/mapbox/mapbox-gl-native/issues/5814
*
+ *
+ * @deprecated use runtime styling to cluster markers instead
*/
+@Deprecated
public class ClusterManagerPlugin implements
MapboxMap.OnCameraIdleListener,
MapboxMap.OnMarkerClickListener,
@@ -56,10 +59,12 @@ public class ClusterManagerPlugin implements
private OnClusterItemInfoWindowClickListener mOnClusterItemInfoWindowClickListener;
private OnClusterClickListener mOnClusterClickListener;
+ @Deprecated
public ClusterManagerPlugin(Context context, MapboxMap map) {
this(context, map, new MarkerManager(map));
}
+ @Deprecated
public ClusterManagerPlugin(Context context, MapboxMap map, MarkerManager markerManager) {
mMap = map;
mMarkerManager = markerManager;
@@ -71,18 +76,22 @@ public ClusterManagerPlugin(Context context, MapboxMap map, MarkerManager marker
mRenderer.onAdd();
}
+ @Deprecated
public MarkerManager.Collection getMarkerCollection() {
return mMarkers;
}
+ @Deprecated
public MarkerManager.Collection getClusterMarkerCollection() {
return mClusterMarkers;
}
+ @Deprecated
public MarkerManager getMarkerManager() {
return mMarkerManager;
}
+ @Deprecated
public void setRenderer(ClusterRenderer view) {
mRenderer.setOnClusterClickListener(null);
mRenderer.setOnClusterItemClickListener(null);
@@ -98,6 +107,7 @@ public void setRenderer(ClusterRenderer view) {
cluster();
}
+ @Deprecated
public void setAlgorithm(Algorithm algorithm) {
mAlgorithmLock.writeLock().lock();
try {
@@ -111,18 +121,22 @@ public void setAlgorithm(Algorithm algorithm) {
cluster();
}
+ @Deprecated
public void setAnimation(boolean animate) {
mRenderer.setAnimation(animate);
}
+ @Deprecated
public ClusterRenderer getRenderer() {
return mRenderer;
}
+ @Deprecated
public Algorithm getAlgorithm() {
return mAlgorithm;
}
+ @Deprecated
public void clearItems() {
mAlgorithmLock.writeLock().lock();
try {
@@ -132,6 +146,7 @@ public void clearItems() {
}
}
+ @Deprecated
public void addItems(Collection items) {
mAlgorithmLock.writeLock().lock();
try {
@@ -142,6 +157,7 @@ public void addItems(Collection items) {
}
+ @Deprecated
public void addItem(T myItem) {
mAlgorithmLock.writeLock().lock();
try {
@@ -151,6 +167,7 @@ public void addItem(T myItem) {
}
}
+ @Deprecated
public void removeItem(T item) {
mAlgorithmLock.writeLock().lock();
try {
@@ -162,7 +179,10 @@ public void removeItem(T item) {
/**
* Force a re-cluster. You may want to call this after adding new item(s).
+ *
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public void cluster() {
mClusterTaskLock.writeLock().lock();
try {
@@ -181,7 +201,10 @@ public void cluster() {
/**
* Might re-cluster.
+ *
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
@Override
public void onCameraIdle() {
Timber.d("OnCamerIdle");
@@ -199,12 +222,14 @@ public void onCameraIdle() {
cluster();
}
+ @Deprecated
@Override
public boolean onInfoWindowClick(@NonNull Marker marker) {
getMarkerManager().onInfoWindowClick(marker);
return true;
}
+ @Deprecated
@Override
public boolean onMarkerClick(Marker marker) {
return getMarkerManager().onMarkerClick(marker);
@@ -233,7 +258,10 @@ protected void onPostExecute(Set extends Cluster> clusters) {
/**
* Sets a callback that's invoked when a Cluster is tapped. Note: For this listener to function,
* the ClusterManagerPlugin must be added as a click listener to the map.
+ *
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public void setOnClusterClickListener(OnClusterClickListener listener) {
mOnClusterClickListener = listener;
mRenderer.setOnClusterClickListener(listener);
@@ -242,7 +270,10 @@ public void setOnClusterClickListener(OnClusterClickListener listener) {
/**
* Sets a callback that's invoked when a Cluster is tapped. Note: For this listener to function,
* the ClusterManagerPlugin must be added as a info window click listener to the map.
+ *
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public void setOnClusterInfoWindowClickListener(OnClusterInfoWindowClickListener listener) {
mOnClusterInfoWindowClickListener = listener;
mRenderer.setOnClusterInfoWindowClickListener(listener);
@@ -251,7 +282,10 @@ public void setOnClusterInfoWindowClickListener(OnClusterInfoWindowClickListener
/**
* Sets a callback that's invoked when an individual ClusterItem is tapped. Note: For this
* listener to function, the ClusterManagerPlugin must be added as a click listener to the map.
+ *
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public void setOnClusterItemClickListener(OnClusterItemClickListener listener) {
mOnClusterItemClickListener = listener;
mRenderer.setOnClusterItemClickListener(listener);
@@ -260,7 +294,10 @@ public void setOnClusterItemClickListener(OnClusterItemClickListener listener
/**
* Sets a callback that's invoked when an individual ClusterItem's Info Window is tapped. Note: For this
* listener to function, the ClusterManagerPlugin must be added as a info window click listener to the map.
+ *
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public void setOnClusterItemInfoWindowClickListener(OnClusterItemInfoWindowClickListener listener) {
mOnClusterItemInfoWindowClickListener = listener;
mRenderer.setOnClusterItemInfoWindowClickListener(listener);
@@ -268,28 +305,40 @@ public void setOnClusterItemInfoWindowClickListener(OnClusterItemInfoWindowClick
/**
* Called when a Cluster is clicked.
+ *
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public interface OnClusterClickListener {
public boolean onClusterClick(Cluster cluster);
}
/**
* Called when a Cluster's Info Window is clicked.
+ *
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public interface OnClusterInfoWindowClickListener {
public void onClusterInfoWindowClick(Cluster cluster);
}
/**
* Called when an individual ClusterItem is clicked.
+ *
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public interface OnClusterItemClickListener {
public boolean onClusterItemClick(T item);
}
/**
* Called when an individual ClusterItem's Info Window is clicked.
+ *
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public interface OnClusterItemInfoWindowClickListener {
public void onClusterItemInfoWindowClick(T item);
}
diff --git a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/algo/Algorithm.java b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/algo/Algorithm.java
index 5bf2423e7..bfac8888c 100755
--- a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/algo/Algorithm.java
+++ b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/algo/Algorithm.java
@@ -11,7 +11,10 @@
*
* Inspired by https://github.com/googlemaps/android-maps-utils.
*
+ *
+ * @deprecated use runtime styling to cluster markers instead
*/
+@Deprecated
public interface Algorithm {
void addItem(T item);
diff --git a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/algo/GridBasedAlgorithm.java b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/algo/GridBasedAlgorithm.java
index 0bb3418ae..e3b3246e5 100755
--- a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/algo/GridBasedAlgorithm.java
+++ b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/algo/GridBasedAlgorithm.java
@@ -17,7 +17,10 @@
*
* Inspired by https://github.com/googlemaps/android-maps-utils.
*
+ *
+ * @deprecated use runtime styling to cluster markers instead
*/
+@Deprecated
public class GridBasedAlgorithm implements Algorithm {
private static final int GRID_SIZE = 100;
@@ -25,26 +28,31 @@ public class GridBasedAlgorithm implements Algorithm {
private final Set mItems = Collections.synchronizedSet(new HashSet());
+ @Deprecated
@Override
public void addItem(T item) {
mItems.add(item);
}
+ @Deprecated
@Override
public void addItems(Collection items) {
mItems.addAll(items);
}
+ @Deprecated
@Override
public void clearItems() {
mItems.clear();
}
+ @Deprecated
@Override
public void removeItem(T item) {
mItems.remove(item);
}
+ @Deprecated
@Override
public Set extends Cluster> getClusters(double zoom) {
long numCells = (long) Math.ceil(256 * Math.pow(2, zoom) / mGridSize);
@@ -72,16 +80,19 @@ public Set extends Cluster> getClusters(double zoom) {
return clusters;
}
+ @Deprecated
@Override
public Collection getItems() {
return mItems;
}
+ @Deprecated
@Override
public void setMaxDistanceBetweenClusteredItems(int maxDistance) {
mGridSize = maxDistance;
}
+ @Deprecated
@Override
public int getMaxDistanceBetweenClusteredItems() {
return mGridSize;
diff --git a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/algo/NonHierarchicalDistanceBasedAlgorithm.java b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/algo/NonHierarchicalDistanceBasedAlgorithm.java
index c6347ee06..57b2a58bc 100755
--- a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/algo/NonHierarchicalDistanceBasedAlgorithm.java
+++ b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/algo/NonHierarchicalDistanceBasedAlgorithm.java
@@ -32,7 +32,10 @@
*
* Inspired by https://github.com/googlemaps/android-maps-utils.
*
+ *
+ * @deprecated use runtime styling to cluster markers instead
*/
+@Deprecated
public class NonHierarchicalDistanceBasedAlgorithm implements Algorithm {
public static final int MAX_DISTANCE_AT_ZOOM = 100; // essentially 100 dp.
@@ -50,6 +53,7 @@ public class NonHierarchicalDistanceBasedAlgorithm implem
private static final SphericalMercatorProjection PROJECTION = new SphericalMercatorProjection(1);
+ @Deprecated
@Override
public void addItem(T item) {
final QuadItem quadItem = new QuadItem(item);
@@ -59,6 +63,7 @@ public void addItem(T item) {
}
}
+ @Deprecated
@Override
public void addItems(Collection items) {
for (T item : items) {
@@ -66,6 +71,7 @@ public void addItems(Collection items) {
}
}
+ @Deprecated
@Override
public void clearItems() {
synchronized (mQuadTree) {
@@ -74,6 +80,7 @@ public void clearItems() {
}
}
+ @Deprecated
@Override
public void removeItem(T item) {
// QuadItem delegates hashcode() and equals() to its item so,
@@ -85,6 +92,7 @@ public void removeItem(T item) {
}
}
+ @Deprecated
@Override
public Set extends Cluster> getClusters(double zoom) {
final int discreteZoom = (int) zoom;
@@ -137,6 +145,7 @@ public Set extends Cluster> getClusters(double zoom) {
return results;
}
+ @Deprecated
@Override
public Collection getItems() {
final List items = new ArrayList();
@@ -148,11 +157,13 @@ public Collection getItems() {
return items;
}
+ @Deprecated
@Override
public void setMaxDistanceBetweenClusteredItems(int maxDistance) {
mMaxDistance = maxDistance;
}
+ @Deprecated
@Override
public int getMaxDistanceBetweenClusteredItems() {
return mMaxDistance;
@@ -182,31 +193,37 @@ private QuadItem(T item) {
singletonSet = Collections.singleton(mClusterItem);
}
+ @Deprecated
@Override
public Point getPoint() {
return mPoint;
}
+ @Deprecated
@Override
public LatLng getPosition() {
return mPosition;
}
+ @Deprecated
@Override
public Set getItems() {
return singletonSet;
}
+ @Deprecated
@Override
public int getSize() {
return 1;
}
+ @Deprecated
@Override
public int hashCode() {
return mClusterItem.hashCode();
}
+ @Deprecated
@Override
public boolean equals(Object other) {
if (!(other instanceof QuadItem>)) {
diff --git a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/algo/PreCachingAlgorithmDecorator.java b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/algo/PreCachingAlgorithmDecorator.java
index b9c71bc43..39a1753d3 100755
--- a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/algo/PreCachingAlgorithmDecorator.java
+++ b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/algo/PreCachingAlgorithmDecorator.java
@@ -15,34 +15,42 @@
*
* Inspired by https://github.com/googlemaps/android-maps-utils.
*
+ *
+ * @deprecated use runtime styling to cluster markers instead
*/
+@Deprecated
public class PreCachingAlgorithmDecorator implements Algorithm {
private final Algorithm mAlgorithm;
private final LruCache>> mCache = new LruCache<>(5);
private final ReadWriteLock mCacheLock = new ReentrantReadWriteLock();
+ @Deprecated
public PreCachingAlgorithmDecorator(Algorithm algorithm) {
mAlgorithm = algorithm;
}
+ @Deprecated
public void addItem(T item) {
mAlgorithm.addItem(item);
clearCache();
}
+ @Deprecated
@Override
public void addItems(Collection items) {
mAlgorithm.addItems(items);
clearCache();
}
+ @Deprecated
@Override
public void clearItems() {
mAlgorithm.clearItems();
clearCache();
}
+ @Deprecated
public void removeItem(T item) {
mAlgorithm.removeItem(item);
clearCache();
@@ -52,6 +60,7 @@ private void clearCache() {
mCache.evictAll();
}
+ @Deprecated
@Override
public Set extends Cluster> getClusters(double zoom) {
int discreteZoom = (int) zoom;
@@ -65,17 +74,20 @@ public Set extends Cluster> getClusters(double zoom) {
return results;
}
+ @Deprecated
@Override
public Collection getItems() {
return mAlgorithm.getItems();
}
+ @Deprecated
@Override
public void setMaxDistanceBetweenClusteredItems(int maxDistance) {
mAlgorithm.setMaxDistanceBetweenClusteredItems(maxDistance);
clearCache();
}
+ @Deprecated
@Override
public int getMaxDistanceBetweenClusteredItems() {
return mAlgorithm.getMaxDistanceBetweenClusteredItems();
@@ -102,10 +114,12 @@ private Set extends Cluster> getClustersInternal(int discreteZoom) {
private class PrecacheRunnable implements Runnable {
private final int mZoom;
+ @Deprecated
public PrecacheRunnable(int zoom) {
mZoom = zoom;
}
+ @Deprecated
@Override
public void run() {
try {
diff --git a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/algo/StaticCluster.java b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/algo/StaticCluster.java
index cf4d903ef..37105b7bf 100755
--- a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/algo/StaticCluster.java
+++ b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/algo/StaticCluster.java
@@ -13,38 +13,48 @@
*
* Inspired by https://github.com/googlemaps/android-maps-utils.
*
+ *
+ * @deprecated use runtime styling to cluster markers instead
*/
+@Deprecated
public class StaticCluster implements Cluster {
private final LatLng mCenter;
private final List mItems = new ArrayList();
+ @Deprecated
public StaticCluster(LatLng center) {
mCenter = center;
}
+ @Deprecated
public boolean add(T t) {
return mItems.add(t);
}
+ @Deprecated
@Override
public LatLng getPosition() {
return mCenter;
}
+ @Deprecated
public boolean remove(T t) {
return mItems.remove(t);
}
+ @Deprecated
@Override
public Collection getItems() {
return mItems;
}
+ @Deprecated
@Override
public int getSize() {
return mItems.size();
}
+ @Deprecated
@Override
public String toString() {
return "StaticCluster{"
@@ -53,11 +63,13 @@ public String toString() {
+ '}';
}
+ @Deprecated
@Override
public int hashCode() {
return mCenter.hashCode() + mItems.hashCode();
}
+ @Deprecated
@Override
public boolean equals(Object other) {
if (!(other instanceof StaticCluster>)) {
diff --git a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/view/ClusterRenderer.java b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/view/ClusterRenderer.java
index 6a433be4e..88f462d61 100755
--- a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/view/ClusterRenderer.java
+++ b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/view/ClusterRenderer.java
@@ -11,7 +11,10 @@
*
* Inspired by https://github.com/googlemaps/android-maps-utils.
*
+ *
+ * @deprecated use runtime styling to cluster markers instead
*/
+@Deprecated
public interface ClusterRenderer {
/**
diff --git a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/view/DefaultClusterRenderer.java b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/view/DefaultClusterRenderer.java
index 6c115cb0c..13704fc86 100755
--- a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/view/DefaultClusterRenderer.java
+++ b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/clustering/view/DefaultClusterRenderer.java
@@ -58,7 +58,10 @@
*
* Inspired by https://github.com/googlemaps/android-maps-utils.
*
+ *
+ * @deprecated use runtime styling to cluster markers instead
*/
+@Deprecated
public class DefaultClusterRenderer implements ClusterRenderer {
private static final boolean SHOULD_ANIMATE = Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB;
private final MapboxMap mMap;
@@ -114,6 +117,7 @@ public class DefaultClusterRenderer implements ClusterRen
private ClusterManagerPlugin.OnClusterItemClickListener mItemClickListener;
private ClusterManagerPlugin.OnClusterItemInfoWindowClickListener mItemInfoWindowClickListener;
+ @Deprecated
public DefaultClusterRenderer(Context context, MapboxMap map, ClusterManagerPlugin clusterManagerPlugin) {
mMap = map;
mAnimate = true;
@@ -125,6 +129,7 @@ public DefaultClusterRenderer(Context context, MapboxMap map, ClusterManagerPlug
mClusterManagerPlugin = clusterManagerPlugin;
}
+ @Deprecated
@Override
public void onAdd() {
mClusterManagerPlugin.getMarkerCollection().setOnMarkerClickListener(new MapboxMap.OnMarkerClickListener() {
@@ -163,6 +168,7 @@ public boolean onInfoWindowClick(Marker marker) {
});
}
+ @Deprecated
@Override
public void onRemove() {
mClusterManagerPlugin.getMarkerCollection().setOnMarkerClickListener(null);
@@ -247,6 +253,7 @@ private class ViewModifier extends Handler {
private boolean mViewModificationInProgress = false;
private RenderTask mNextClusters = null;
+ @Deprecated
@Override
public void handleMessage(Message msg) {
if (msg.what == TASK_FINISHED) {
@@ -335,20 +342,26 @@ private RenderTask(Set extends Cluster> clusters) {
/**
* A callback to be run when all work has been completed.
+ *
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public void setCallback(Runnable callback) {
mCallback = callback;
}
+ @Deprecated
public void setProjection(Projection projection) {
this.mProjection = projection;
}
+ @Deprecated
public void setMapZoom(float zoom) {
this.mMapZoom = zoom;
this.mSphericalMercatorProjection = new SphericalMercatorProjection(256 * Math.pow(2, Math.min(zoom, mZoom)));
}
+ @Deprecated
@SuppressLint("NewApi")
public void run() {
if (clusters.equals(DefaultClusterRenderer.this.mClusters)) {
@@ -446,32 +459,38 @@ public void run() {
}
}
+ @Deprecated
@Override
public void onClustersChanged(Set extends Cluster> clusters) {
mViewModifier.queue(clusters);
}
+ @Deprecated
@Override
public void setOnClusterClickListener(ClusterManagerPlugin.OnClusterClickListener listener) {
mClickListener = listener;
}
+ @Deprecated
@Override
public void setOnClusterInfoWindowClickListener(ClusterManagerPlugin.OnClusterInfoWindowClickListener listener) {
mInfoWindowClickListener = listener;
}
+ @Deprecated
@Override
public void setOnClusterItemClickListener(ClusterManagerPlugin.OnClusterItemClickListener listener) {
mItemClickListener = listener;
}
+ @Deprecated
@Override
public void setOnClusterItemInfoWindowClickListener(
ClusterManagerPlugin.OnClusterItemInfoWindowClickListener listener) {
mItemInfoWindowClickListener = listener;
}
+ @Deprecated
@Override
public void setAnimation(boolean animate) {
mAnimate = animate;
@@ -530,7 +549,9 @@ private MarkerModifier() {
* Creates markers for a cluster some time in the future.
*
* @param priority whether this operation should have priority.
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public void add(boolean priority, CreateMarkerTask c) {
lock.lock();
sendEmptyMessage(BLANK);
@@ -547,7 +568,9 @@ public void add(boolean priority, CreateMarkerTask c) {
*
* @param priority whether this operation should have priority.
* @param m the markerWithPosition to remove.
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public void remove(boolean priority, Marker m) {
lock.lock();
sendEmptyMessage(BLANK);
@@ -565,7 +588,9 @@ public void remove(boolean priority, Marker m) {
* @param marker the markerWithPosition to animate.
* @param from the position to animate from.
* @param to the position to animate to.
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public void animate(MarkerWithPosition marker, LatLng from, LatLng to) {
lock.lock();
mAnimationTasks.add(new AnimationTask(marker, from, to));
@@ -579,7 +604,9 @@ public void animate(MarkerWithPosition marker, LatLng from, LatLng to) {
* @param marker the markerWithPosition to animate.
* @param from the position to animate from.
* @param to the position to animate to.
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public void animateThenRemove(MarkerWithPosition marker, LatLng from, LatLng to) {
lock.lock();
@@ -589,6 +616,7 @@ public void animateThenRemove(MarkerWithPosition marker, LatLng from, LatLng to)
lock.unlock();
}
+ @Deprecated
@Override
public void handleMessage(Message msg) {
if (!mListenerAdded) {
@@ -651,7 +679,9 @@ private void removeMarker(Marker m) {
/**
* @return true if there is still work to be processed.
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public boolean isBusy() {
try {
lock.lock();
@@ -665,7 +695,9 @@ public boolean isBusy() {
/**
* Blocks the calling thread until all work has been processed.
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public void waitUntilFree() {
while (isBusy()) {
// Sometimes the idle queue may not be called - schedule up some work regardless
@@ -684,6 +716,7 @@ public void waitUntilFree() {
}
}
+ @Deprecated
@Override
public boolean queueIdle() {
// When the UI is not busy, schedule some work.
@@ -699,19 +732,23 @@ private static class MarkerCache {
private Map mCache = new HashMap();
private Map mCacheReverse = new HashMap();
+ @Deprecated
public Marker get(T item) {
return mCache.get(item);
}
+ @Deprecated
public T get(Marker m) {
return mCacheReverse.get(m);
}
+ @Deprecated
public void put(T item, Marker m) {
mCache.put(item, m);
mCacheReverse.put(m, item);
}
+ @Deprecated
public void remove(Marker m) {
T item = mCacheReverse.get(m);
mCacheReverse.remove(m);
@@ -758,7 +795,9 @@ protected void onClusterItemRendered(T clusterItem, Marker marker) {
*
* @param clusterItem ClusterItem which you will obtain its marker
* @return a marker from a ClusterItem or null if it does not exists
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public Marker getMarker(T clusterItem) {
return mMarkerCache.get(clusterItem);
}
@@ -768,7 +807,9 @@ public Marker getMarker(T clusterItem) {
*
* @param marker which you will obtain its ClusterItem
* @return a ClusterItem from a marker or null if it does not exists
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public T getClusterItem(Marker marker) {
return mMarkerCache.get(marker);
}
@@ -778,7 +819,9 @@ public T getClusterItem(Marker marker) {
*
* @param cluster which you will obtain its marker
* @return a marker from a cluster or null if it does not exists
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public Marker getMarker(Cluster cluster) {
return mClusterToMarker.get(cluster);
}
@@ -788,7 +831,9 @@ public Marker getMarker(Cluster cluster) {
*
* @param marker which you will obtain its Cluster
* @return a Cluster from a marker or null if it does not exists
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public Cluster getCluster(Marker marker) {
return mMarkerToCluster.get(marker);
}
@@ -806,7 +851,9 @@ private class CreateMarkerTask {
* @param markersAdded a collection of markers to append any created markers.
* @param animateFrom the location to animate the markerWithPosition from, or null if no
* animation is required.
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public CreateMarkerTask(Cluster c, Set markersAdded, LatLng animateFrom) {
this.cluster = c;
this.newMarkers = markersAdded;
@@ -884,6 +931,7 @@ private MarkerWithPosition(Marker marker) {
position = marker.getPosition();
}
+ @Deprecated
@Override
public boolean equals(Object other) {
if (other instanceof MarkerWithPosition) {
@@ -892,6 +940,7 @@ public boolean equals(Object other) {
return false;
}
+ @Deprecated
@Override
public int hashCode() {
return marker.hashCode();
@@ -927,6 +976,7 @@ public void perform() {
valueAnimator.start();
}
+ @Deprecated
@Override
public void onAnimationEnd(Animator animation) {
if (mRemoveOnComplete) {
@@ -939,11 +989,13 @@ public void onAnimationEnd(Animator animation) {
markerWithPosition.position = to;
}
+ @Deprecated
public void removeOnAnimationComplete(MarkerManager markerManager) {
mMarkerManager = markerManager;
mRemoveOnComplete = true;
}
+ @Deprecated
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
float fraction = valueAnimator.getAnimatedFraction();
diff --git a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/data/Geometry.java b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/data/Geometry.java
index 2e584bcec..c24bdb881 100755
--- a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/data/Geometry.java
+++ b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/data/Geometry.java
@@ -7,7 +7,9 @@
*
*
* @param the type of Geometry object
+ * @deprecated use runtime styling to cluster markers instead
*/
+@Deprecated
public interface Geometry {
/**
* Gets the type of geometry
diff --git a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/data/Point.java b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/data/Point.java
index 3dbbc0143..17d16928c 100755
--- a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/data/Point.java
+++ b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/data/Point.java
@@ -7,7 +7,10 @@
*
* Inspired by https://github.com/googlemaps/android-maps-utils.
*
+ *
+ * @deprecated use runtime styling to cluster markers instead
*/
+@Deprecated
public class Point implements Geometry {
private static final String GEOMETRY_TYPE = "Point";
@@ -18,7 +21,9 @@ public class Point implements Geometry {
* Creates a new Point object
*
* @param coordinates coordinates of Point to store
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public Point(LatLng coordinates) {
if (coordinates == null) {
throw new IllegalArgumentException("Coordinates cannot be null");
@@ -30,7 +35,9 @@ public Point(LatLng coordinates) {
* Gets the type of geometry
*
* @return type of geometry
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public String getGeometryType() {
return GEOMETRY_TYPE;
}
@@ -39,11 +46,14 @@ public String getGeometryType() {
* Gets the coordinates of the Point
*
* @return coordinates of the Point
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public LatLng getGeometryObject() {
return mCoordinates;
}
+ @Deprecated
@Override
public String toString() {
StringBuilder sb = new StringBuilder(GEOMETRY_TYPE).append("{");
diff --git a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/geometry/Bounds.java b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/geometry/Bounds.java
index 5d67fa33a..80f40ada9 100755
--- a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/geometry/Bounds.java
+++ b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/geometry/Bounds.java
@@ -5,7 +5,9 @@
*
* Inspired by https://github.com/googlemaps/android-maps-utils.
*
+ * @deprecated use runtime styling to cluster markers instead
*/
+@Deprecated
public class Bounds {
public final double minX;
public final double minY;
@@ -16,6 +18,7 @@ public class Bounds {
public final double midX;
public final double midY;
+ @Deprecated
public Bounds(double minX, double maxX, double minY, double maxY) {
this.minX = minX;
this.minY = minY;
@@ -26,22 +29,27 @@ public Bounds(double minX, double maxX, double minY, double maxY) {
midY = (minY + maxY) / 2;
}
+ @Deprecated
public boolean contains(double x, double y) {
return minX <= x && x <= maxX && minY <= y && y <= maxY;
}
+ @Deprecated
public boolean contains(Point point) {
return contains(point.x, point.y);
}
+ @Deprecated
public boolean intersects(double minX, double maxX, double minY, double maxY) {
return minX < this.maxX && this.minX < maxX && minY < this.maxY && this.minY < maxY;
}
+ @Deprecated
public boolean intersects(Bounds bounds) {
return intersects(bounds.minX, bounds.maxX, bounds.minY, bounds.maxY);
}
+ @Deprecated
public boolean contains(Bounds bounds) {
return bounds.minX >= minX && bounds.maxX <= maxX && bounds.minY >= minY && bounds.maxY <= maxY;
}
diff --git a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/geometry/Point.java b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/geometry/Point.java
index 94d5901ec..8f526b9fc 100755
--- a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/geometry/Point.java
+++ b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/geometry/Point.java
@@ -5,16 +5,21 @@
*
* Inspired by https://github.com/googlemaps/android-maps-utils.
*
+ *
+ * @deprecated use runtime styling to cluster markers instead
*/
+@Deprecated
public class Point {
public final double x;
public final double y;
+ @Deprecated
public Point(double x, double y) {
this.x = x;
this.y = y;
}
+ @Deprecated
@Override
public String toString() {
return "Point{"
diff --git a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/projection/SphericalMercatorProjection.java b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/projection/SphericalMercatorProjection.java
index e1d3ffed5..a1a07720f 100755
--- a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/projection/SphericalMercatorProjection.java
+++ b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/projection/SphericalMercatorProjection.java
@@ -8,14 +8,18 @@
*
* Inspired by https://github.com/googlemaps/android-maps-utils.
*
+ * @deprecated use runtime styling to cluster markers instead
*/
+@Deprecated
public class SphericalMercatorProjection {
final double mWorldWidth;
+ @Deprecated
public SphericalMercatorProjection(final double worldWidth) {
mWorldWidth = worldWidth;
}
+ @Deprecated
public Point toPoint(final LatLng latLng) {
final double x = latLng.getLongitude() / 360 + .5;
final double siny = Math.sin(Math.toRadians(latLng.getLatitude()));
@@ -24,6 +28,7 @@ public Point toPoint(final LatLng latLng) {
return new Point(x * mWorldWidth, y * mWorldWidth);
}
+ @Deprecated
public LatLng toLatLng(com.mapbox.mapboxsdk.plugins.cluster.geometry.Point point) {
final double x = point.x / mWorldWidth - 0.5;
final double lng = x * 360;
diff --git a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/quadtree/PointQuadTree.java b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/quadtree/PointQuadTree.java
index 68d838c25..0f5f9a9fe 100755
--- a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/quadtree/PointQuadTree.java
+++ b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/quadtree/PointQuadTree.java
@@ -14,7 +14,10 @@
*
* Inspired by https://github.com/googlemaps/android-maps-utils.
*
+ *
+ * @deprecated use runtime styling to cluster markers instead
*/
+@Deprecated
public class PointQuadTree {
public interface Item {
public Point getPoint();
@@ -52,11 +55,15 @@ public interface Item {
/**
* Creates a new quad tree with specified bounds.
+ *
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public PointQuadTree(double minX, double maxX, double minY, double maxY) {
this(new Bounds(minX, maxX, minY, maxY));
}
+ @Deprecated
public PointQuadTree(Bounds bounds) {
this(bounds, 0);
}
@@ -72,7 +79,10 @@ private PointQuadTree(Bounds bounds, int depth) {
/**
* Insert an item.
+ *
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public void add(T item) {
Point point = item.getPoint();
if (this.mBounds.contains(point.x, point.y)) {
@@ -129,7 +139,9 @@ private void split() {
* Remove the given item from the set.
*
* @return whether the item was removed.
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public boolean remove(T item) {
Point point = item.getPoint();
if (this.mBounds.contains(point.x, point.y)) {
@@ -165,7 +177,10 @@ private boolean remove(double x, double y, T item) {
/**
* Removes all points from the quadTree
+ *
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public void clear() {
mChildren = null;
if (mItems != null) {
@@ -175,7 +190,10 @@ public void clear() {
/**
* Search for all items within a given bounds.
+ *
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public Collection search(Bounds searchBounds) {
final List results = new ArrayList();
search(searchBounds, results);
diff --git a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/ui/BubbleDrawable.java b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/ui/BubbleDrawable.java
index 34d9f3031..c3cb3e476 100755
--- a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/ui/BubbleDrawable.java
+++ b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/ui/BubbleDrawable.java
@@ -16,22 +16,27 @@
*
* Inspired by https://github.com/googlemaps/android-maps-utils.
*
+ * @deprecated use runtime styling to cluster markers instead
*/
+@Deprecated
class BubbleDrawable extends Drawable {
private final Drawable mShadow;
private final Drawable mMask;
private int mColor = Color.WHITE;
+ @Deprecated
public BubbleDrawable(Resources res) {
mMask = res.getDrawable(R.drawable.mbx_bubble_mask);
mShadow = res.getDrawable(R.drawable.mbx_bubble_shadow);
}
+ @Deprecated
public void setColor(int color) {
mColor = color;
}
+ @Deprecated
@Override
public void draw(Canvas canvas) {
mMask.draw(canvas);
@@ -39,33 +44,39 @@ public void draw(Canvas canvas) {
mShadow.draw(canvas);
}
+ @Deprecated
@Override
public void setAlpha(int alpha) {
throw new UnsupportedOperationException();
}
+ @Deprecated
@Override
public void setColorFilter(ColorFilter cf) {
throw new UnsupportedOperationException();
}
+ @Deprecated
@Override
public int getOpacity() {
return PixelFormat.TRANSLUCENT;
}
+ @Deprecated
@Override
public void setBounds(int left, int top, int right, int bottom) {
mMask.setBounds(left, top, right, bottom);
mShadow.setBounds(left, top, right, bottom);
}
+ @Deprecated
@Override
public void setBounds(Rect bounds) {
mMask.setBounds(bounds);
mShadow.setBounds(bounds);
}
+ @Deprecated
@Override
public boolean getPadding(Rect padding) {
return mMask.getPadding(padding);
diff --git a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/ui/IconGenerator.java b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/ui/IconGenerator.java
index 34ba51348..5eee5abb1 100755
--- a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/ui/IconGenerator.java
+++ b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/ui/IconGenerator.java
@@ -26,7 +26,9 @@
*
* Inspired by https://github.com/googlemaps/android-maps-utils.
*
+ * @deprecated use runtime styling to cluster markers instead
*/
+@Deprecated
public class IconGenerator {
private final Context mContext;
@@ -43,7 +45,10 @@ public class IconGenerator {
/**
* Creates a new IconGenerator with the default style.
+ *
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public IconGenerator(Context context) {
mContext = context;
mBackground = new BubbleDrawable(mContext.getResources());
@@ -57,7 +62,9 @@ public IconGenerator(Context context) {
* Sets the text content, then creates an icon with the current style.
*
* @param text the text content to display inside the icon.
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public Bitmap makeIcon(CharSequence text) {
if (mTextView != null) {
mTextView.setText(text);
@@ -71,7 +78,10 @@ public Bitmap makeIcon(CharSequence text) {
*
* This method is useful if a custom view has previously been set, or if text content is not
* applicable.
+ *
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public Bitmap makeIcon() {
int measureSpec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
mContainer.measure(measureSpec, measureSpec);
@@ -111,7 +121,10 @@ public Bitmap makeIcon() {
*
* If the view contains a {@link TextView} with the id "text", operations such as {@link
* #setTextAppearance} and {@link #makeIcon()} will operate upon that {@link TextView}.
+ *
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public void setContentView(View contentView) {
mRotationLayout.removeAllViews();
mRotationLayout.addView(contentView);
@@ -124,7 +137,9 @@ public void setContentView(View contentView) {
* Rotates the contents of the icon.
*
* @param degrees the amount the contents should be rotated, as a multiple of 90 degrees.
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public void setContentRotation(int degrees) {
mRotationLayout.setViewRotation(degrees);
}
@@ -133,7 +148,9 @@ public void setContentRotation(int degrees) {
* Rotates the icon.
*
* @param degrees the amount the icon should be rotated, as a multiple of 90 degrees.
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public void setRotation(int degrees) {
mRotation = ((degrees + 360) % 360) / 90;
}
@@ -141,14 +158,18 @@ public void setRotation(int degrees) {
/**
* @return u coordinate of the anchor, with rotation applied.
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public float getAnchorU() {
return rotateAnchor(mAnchorU, mAnchorV);
}
/**
* @return v coordinate of the anchor, with rotation applied.
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public float getAnchorV() {
return rotateAnchor(mAnchorV, mAnchorU);
}
@@ -175,7 +196,9 @@ private float rotateAnchor(float u, float v) {
* TextAppearance resource.
*
* @param resid the identifier of the resource.
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public void setTextAppearance(Context context, int resid) {
if (mTextView != null) {
mTextView.setTextAppearance(context, resid);
@@ -187,14 +210,19 @@ public void setTextAppearance(Context context, int resid) {
* TextAppearance resource.
*
* @param resid the identifier of the resource.
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public void setTextAppearance(int resid) {
setTextAppearance(mContext, resid);
}
/**
* Sets the style of the icon. The style consists of a background and text appearance.
+ *
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public void setStyle(int style) {
setColor(getStyleColor(style));
setTextAppearance(mContext, getTextStyle(style));
@@ -204,7 +232,9 @@ public void setStyle(int style) {
* Sets the background to the default, with a given color tint.
*
* @param color the color for the background tint.
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public void setColor(int color) {
mBackground.setColor(color);
setBackground(mBackground);
@@ -214,9 +244,10 @@ public void setColor(int color) {
* Set the background to a given Drawable, or remove the background.
*
* @param background the Drawable to use as the background, or null to remove the background.
+ * @deprecated use runtime styling to cluster markers instead
*/
- @SuppressWarnings("deprecation")
// View#setBackgroundDrawable is compatible with pre-API level 16 (Jelly Bean).
+ @Deprecated
public void setBackground(Drawable background) {
mContainer.setBackgroundDrawable(background);
@@ -239,7 +270,9 @@ public void setBackground(Drawable background) {
* @param top the top padding in pixels.
* @param right the right padding in pixels.
* @param bottom the bottom padding in pixels.
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public void setContentPadding(int left, int top, int right, int bottom) {
mContentView.setPadding(left, top, right, bottom);
}
diff --git a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/ui/RotationLayout.java b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/ui/RotationLayout.java
index b318f90f6..ada5c87d8 100755
--- a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/ui/RotationLayout.java
+++ b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/ui/RotationLayout.java
@@ -13,18 +13,23 @@
*
* Inspired by https://github.com/googlemaps/android-maps-utils.
*
+ * @deprecated use runtime styling to cluster markers instead
*/
+@Deprecated
public class RotationLayout extends FrameLayout {
private int mRotation;
+ @Deprecated
public RotationLayout(Context context) {
super(context);
}
+ @Deprecated
public RotationLayout(Context context, AttributeSet attrs) {
super(context, attrs);
}
+ @Deprecated
public RotationLayout(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@@ -41,12 +46,14 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
/**
* @param degrees the rotation, in degrees.
+ * @deprecated use runtime styling to cluster markers instead
*/
+ @Deprecated
public void setViewRotation(int degrees) {
mRotation = ((degrees + 360) % 360) / 90;
}
-
+ @Deprecated
@Override
public void dispatchDraw(Canvas canvas) {
if (mRotation == 0) {
diff --git a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/ui/SquareTextView.java b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/ui/SquareTextView.java
index 0cbc48500..c0b5a1868 100755
--- a/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/ui/SquareTextView.java
+++ b/plugin-cluster/src/main/java/com/mapbox/mapboxsdk/plugins/cluster/ui/SquareTextView.java
@@ -11,19 +11,24 @@
*
* Inspired by https://github.com/googlemaps/android-maps-utils.
*
+ * @deprecated use runtime styling to cluster markers instead
*/
+@Deprecated
public class SquareTextView extends AppCompatTextView {
private int mOffsetTop = 0;
private int mOffsetLeft = 0;
+ @Deprecated
public SquareTextView(Context context) {
super(context);
}
+ @Deprecated
public SquareTextView(Context context, AttributeSet attrs) {
super(context, attrs);
}
+ @Deprecated
public SquareTextView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@@ -44,6 +49,7 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
setMeasuredDimension(dimension, dimension);
}
+ @Deprecated
@Override
public void draw(Canvas canvas) {
canvas.translate(mOffsetLeft / 2, mOffsetTop / 2);