【发布时间】:2013-08-27 18:54:03
【问题描述】:
我想在我的android项目https://github.com/twotoasters/clusterkraf中使用Clusterkraf,我也导入成功了。我设置了三个具有相同位置的标记。但是,当我查看地图时,我看到了 1 个标记。我希望看到一个带有 3 的蓝色图标。
我认为群集功能无法正常工作。我需要一些特殊的代码来配置它吗?
这是我目前所拥有的:
在此,我得到一个点列表,然后我制作了InputPoint 对象的列表,然后我用它来创建 clusterkraf 地图。我还需要做什么才能使集群功能发挥作用?
public void MakeMarkerArray(ArrayList<ObjMarker> locationList) {
LatLng latlong;
ObjPoint point;
BitmapDescriptor bm = BitmapDescriptorFactory.fromResource(R.drawable.marker);
for(ObjMarker po : locationList) {
latlong = AddressToLatLong(po.location);
if (latlong != null) {
point = new ObjPoint(latlong);
inputPoints.add(new InputPoint(point.latLng, point));
//Marker newmarker = map.addMarker(new MarkerOptions().position(latlong).icon(bm));
//markerID.put(newmarker.getId(), po);
}
}
if (map != null && inputPoints != null && inputPoints.size() > 0) {
com.twotoasters.clusterkraf.Options options = new com.twotoasters.clusterkraf.Options();
// customize the options before you construct a Clusterkraf instance
clusterkraf = new Clusterkraf(map, options, inputPoints);
}
}
谢谢。
【问题讨论】:
-
我完全感觉到你,clusterkraf的api很不方便。这是提到的 lib Maicej 的更新链接:github.com/mg6maciej/android-maps-extensions
标签: java android google-maps-android-api-2