本文整理汇总了Java中com.google.maps.android.clustering.Cluster.getSize方法的典型用法代码示例。如果您正苦于以下问题:Java Cluster.getSize方法的具体用法?Java Cluster.getSize怎么用?Java Cluster.getSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.maps.android.clustering.Cluster
的用法示例。
在下文中一共展示了Cluster.getSize方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onBeforeClusterRendered
import com.google.maps.android.clustering.Cluster; //导入方法依赖的package包/类
@Override
protected void onBeforeClusterRendered(Cluster<IssueMarker> cluster, MarkerOptions options) {
super.onBeforeClusterRendered(cluster, options);
// Cluster customization
Context context = mMap.getContext();
int clusterSize = cluster.getSize();
String clusterIconRes = "cluster1";
for (int i = 0; i < CLUSTER_THRESHOLDS.length; i++) {
int threshold = CLUSTER_THRESHOLDS[i];
if (clusterSize >= threshold) clusterIconRes = "cluster" + (i + 2);
}
mClusterIconGenerator.setBackground(getClusterIcon(context, clusterIconRes));
mClusterIconGenerator.setTextAppearance(R.style.ClusterIconText);
Bitmap sizeIcon = mClusterIconGenerator.makeIcon(String.valueOf(clusterSize));
options.icon(BitmapDescriptorFactory.fromBitmap(sizeIcon));
}
示例2: getBucket
import com.google.maps.android.clustering.Cluster; //导入方法依赖的package包/类
/**
* Gets the "bucket" for a particular cluster. By default, uses the number of points within the
* cluster, bucketed to some set points.
*/
protected int getBucket(Cluster<T> cluster) {
int size = cluster.getSize();
if (size <= BUCKETS[0]) {
return size;
}
for (int i = 0; i < BUCKETS.length - 1; i++) {
if (size < BUCKETS[i + 1]) {
return BUCKETS[i];
}
}
return BUCKETS[BUCKETS.length - 1];
}
示例3: shouldRenderAsCluster
import com.google.maps.android.clustering.Cluster; //导入方法依赖的package包/类
@Override
protected boolean shouldRenderAsCluster(Cluster<CustomMarker> cluster) {
return cluster.getSize() > 1;
}
示例4: shouldRenderAsCluster
import com.google.maps.android.clustering.Cluster; //导入方法依赖的package包/类
@Override
protected boolean shouldRenderAsCluster(Cluster<Detail> cluster) {
return cluster.getSize() > MIN_CLUSTER_SIZE;
}
示例5: shouldRenderAsCluster
import com.google.maps.android.clustering.Cluster; //导入方法依赖的package包/类
@Override
protected boolean shouldRenderAsCluster(Cluster cluster) {
// Always render clusters.
return cluster.getSize() > 1;
}
开发者ID:aminyazdanpanah,项目名称:google-maps-3D-pie-chart-marker-clustering-java,代码行数:6,代码来源:DemoActivity.java
示例6: shouldRenderAsCluster
import com.google.maps.android.clustering.Cluster; //导入方法依赖的package包/类
/**
* Determine whether the cluster should be rendered as individual markers or a cluster.
*/
protected boolean shouldRenderAsCluster(Cluster<T> cluster) {
return cluster.getSize() > MIN_CLUSTER_SIZE;
}
示例7: onBeforeClusterRendered
import com.google.maps.android.clustering.Cluster; //导入方法依赖的package包/类
@Override
protected void onBeforeClusterRendered(Cluster<DB_Location_NoeC> cluster, MarkerOptions markerOptions) {
// Draw multiple people.
// Note: this method runs on the UI thread. Don't spend too much time in here (like in this example).
/*List<Drawable> profilePhotos = new ArrayList<Drawable>(Math.min(4, cluster.getSize()));
int width = mDimension;
int height = mDimension;
for (Person p : cluster.getItems()) {
// Draw 4 at most.
if (profilePhotos.size() == 4) break;
Drawable drawable = getResources().getDrawable(p.profilePhoto);
drawable.setBounds(0, 0, width, height);
profilePhotos.add(drawable);
}
MultiDrawable multiDrawable = new MultiDrawable(profilePhotos);
multiDrawable.setBounds(0, 0, width, height);
mClusterImageView.setImageDrawable(multiDrawable);
Bitmap icon = mClusterIconGenerator.makeIcon(String.valueOf(cluster.getSize()));*/
boolean useOpenData = this.prefs.getBoolean(Activity_Settings.KEY_PREF_LOAD_OPEN_DATA, false);
String idstring = "";
int iterator = 0;
int active = 0;
int notactive = 0;
for (DB_Location_NoeC loc : cluster.getItems()) {
idstring += String.valueOf(loc.getId());
if(iterator<cluster.getSize()-1) {
idstring += ";";
}
if(loc.getTodayActive()) {
active ++;
} else {
notactive ++;
}
iterator++;
}
if(iterator == active && useOpenData) {
// all active
markerOptions.icon(BitmapDescriptorFactory.fromResource(R.mipmap.ic_noe_multimarker_active));
} else if(iterator == notactive && useOpenData) {
// all not active
markerOptions.icon(BitmapDescriptorFactory.fromResource(R.mipmap.ic_noe_multimarker_inactive));
} else {
// mixed
markerOptions.icon(BitmapDescriptorFactory.fromResource(R.mipmap.ic_noe_multimarker_mixed));
}
markerOptions.snippet(idstring);
}
示例8: shouldRenderAsCluster
import com.google.maps.android.clustering.Cluster; //导入方法依赖的package包/类
@Override
protected boolean shouldRenderAsCluster(Cluster cluster) {
// Always render clusters.
return cluster.getSize() > 5;
}
示例9: shouldRenderAsCluster
import com.google.maps.android.clustering.Cluster; //导入方法依赖的package包/类
/**
* Determine whether the cluster should be rendered as individual markers or a cluster.
*/
protected boolean shouldRenderAsCluster(Cluster cluster) {
return cluster.getSize() > MIN_CLUSTER_SIZE;
}
示例10: shouldRenderAsCluster
import com.google.maps.android.clustering.Cluster; //导入方法依赖的package包/类
@Override
protected boolean shouldRenderAsCluster(Cluster<Stop> cluster) {
return cluster.getSize() > MIN_CLUSTER_SIZE;
}
示例11: shouldRenderAsCluster
import com.google.maps.android.clustering.Cluster; //导入方法依赖的package包/类
@Override
protected boolean shouldRenderAsCluster(Cluster<T> cluster) {
//start clustering if at least 2 items overlap
return cluster.getSize() > 1;
}
示例12: shouldRenderAsCluster
import com.google.maps.android.clustering.Cluster; //导入方法依赖的package包/类
/**
* Determine whether the cluster should be rendered as individual markers or a cluster.
*/
protected boolean shouldRenderAsCluster(Cluster<T> cluster) {
return cluster.getSize() > mMinClusterSize;
}