当前位置: 首页>>代码示例>>Java>>正文


Java Cluster.getSize方法代码示例

本文整理汇总了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));
}
 
开发者ID:ArnauBlanch,项目名称:civify-app,代码行数:17,代码来源:IssueMarkerClusterRenderer.java

示例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];
}
 
开发者ID:JohannesRudolph,项目名称:Freifunk-App,代码行数:17,代码来源:NodeClusterRenderer.java

示例3: shouldRenderAsCluster

import com.google.maps.android.clustering.Cluster; //导入方法依赖的package包/类
@Override
protected boolean shouldRenderAsCluster(Cluster<CustomMarker> cluster) {
    return cluster.getSize() > 1;
}
 
开发者ID:typebrook,项目名称:FiveMinsMore,代码行数:5,代码来源:CustomRenderer.java

示例4: shouldRenderAsCluster

import com.google.maps.android.clustering.Cluster; //导入方法依赖的package包/类
@Override
protected boolean shouldRenderAsCluster(Cluster<Detail> cluster) {
    return cluster.getSize() > MIN_CLUSTER_SIZE;
}
 
开发者ID:googlesamples,项目名称:android-OurStreets,代码行数:5,代码来源:DetailMarkerRenderer.java

示例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;
}
 
开发者ID:JohannesRudolph,项目名称:Freifunk-App,代码行数:7,代码来源:NodeClusterRenderer.java

示例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);

}
 
开发者ID:derqurps,项目名称:noefinderlein,代码行数:51,代码来源:Activity_Map.java

示例8: shouldRenderAsCluster

import com.google.maps.android.clustering.Cluster; //导入方法依赖的package包/类
@Override
protected boolean shouldRenderAsCluster(Cluster cluster) {
    // Always render clusters.
    return cluster.getSize() > 5;
}
 
开发者ID:derqurps,项目名称:noefinderlein,代码行数:6,代码来源:Activity_Map.java

示例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;
}
 
开发者ID:dklisiaris,项目名称:downtown,代码行数:7,代码来源:DefaultClusterRenderer.java

示例10: shouldRenderAsCluster

import com.google.maps.android.clustering.Cluster; //导入方法依赖的package包/类
@Override
protected boolean shouldRenderAsCluster(Cluster<Stop> cluster) {
    return cluster.getSize() > MIN_CLUSTER_SIZE;
}
 
开发者ID:runningcode,项目名称:CUMtd,代码行数:5,代码来源:StopPointRenderer.java

示例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;
}
 
开发者ID:TruckMuncher,项目名称:TruckMuncher-Android,代码行数:6,代码来源:TruckClusterRenderer.java

示例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;
}
 
开发者ID:googlemaps,项目名称:android-maps-utils,代码行数:7,代码来源:DefaultClusterRenderer.java


注:本文中的com.google.maps.android.clustering.Cluster.getSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。