【问题标题】:Why cluster marker icon not showing when zoom in or zoom out in android [duplicate]为什么在android中放大或缩小时不显示集群标记图标[重复]
【发布时间】:2016-05-19 07:29:40
【问题描述】:

我正在尝试在我的地图上实现一个集群标记,首先,它向我显示集群标记,但是当我放大时,它会展开并显示白色方块,我将添加一些图像以更好地解释它。

images

public class MyItem implements ClusterItem {
        private final LatLng mPosition;
        String Title = "";
        int Icon;

        public MyItem(double lat, double lng, String title, int icon) {
            mPosition = new LatLng(lat, lng);
            Title = title;
            Icon = icon;
        }

        @Override
        public LatLng getPosition() {
            return mPosition;
        }

        public String getTitle() {
            return Title;
        }

        public int getIcon() {
            return Icon;
        }
    }
class OwnIconRendered extends DefaultClusterRenderer<MyItem> {


        public OwnIconRendered() {
            super(MapActivity.this, googleMap, mClusterManager);

        }

        @Override
        protected void onBeforeClusterItemRendered(MyItem item, MarkerOptions markerOptions) {
            markerOptions.icon(BitmapDescriptorFactory.fromResource(item.getIcon()));
            markerOptions.title(item.getTitle());
            super.onBeforeClusterItemRendered(item, markerOptions);
        }



        @Override
        protected void onBeforeClusterRendered(Cluster<MyItem> cluster, MarkerOptions markerOptions) {
            super.onBeforeClusterRendered(cluster, markerOptions);
        }

    }

【问题讨论】:

  • 你能告诉我们你是如何生成标记的代码吗?另外,网速快吗?
  • 是的,我只是编辑答案。
  • 非常感谢

标签: android google-maps google-maps-api-3 markerclusterer


【解决方案1】:

gmaps-api-issues 上有一个未解决的问题,请看这里:https://code.google.com/p/gmaps-api-issues/issues/detail?id=9765

也看这里:Google map marker is replaced by bounding rectangle on zoom

那里还描述了一些解决方法。

【讨论】:

  • 非常感谢
猜你喜欢
  • 2011-04-06
  • 2015-01-29
  • 2017-10-02
  • 2014-02-24
  • 1970-01-01
  • 2015-02-02
  • 2019-07-05
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多