Ich verwende MapCustomClustering, um Bilder auf der Karte anzuzeigen. Das Cluster-Symbol zeigt auch die Anzahl der Elemente im Cluster an, es wird jedoch nicht in meinem Cluster angezeigt. Ich lade Daten aus der Parse Cloud. Im Beispiel wird cluster.getSize() gerendert, aber in meinem Fall funktioniert es nicht.MapClustering wird nicht gerendert String.valueof (cluster.getSize)
@Override
protected void onBeforeClusterRendered(final Cluster<MapPosts> cluster, final 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).
final List<Drawable> profilePhotos = new ArrayList<>(Math.min(4, cluster.getSize()));
final int width = mDimension;
final int height = mDimension;
int i = 0;
for (MapPosts p : cluster.getItems()) {
// Draw 4 at most.
i++;
Picasso.with(getApplicationContext())
.load(String.valueOf(p.profilePhoto))
.into(new Target() {
@Override
public void onBitmapLoaded(final Bitmap bitmap, Picasso.LoadedFrom from) {
Drawable drawable = new BitmapDrawable(getResources(), bitmap);
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()));
markerOptions.icon(BitmapDescriptorFactory.fromBitmap(icon));
}
@Override
public void onBitmapFailed(Drawable errorDrawable) {
}
@Override
public void onPrepareLoad(Drawable placeHolderDrawable) {
}
});
if (profilePhotos.size() == 4) break;
}
}
Ich habe genau das gleiche Problem! – John
Ich habe auch das gleiche Problem, bitte kann jeder Körper korrigieren, dass ich große Schwierigkeiten habe. –
@Savita Haben Sie dieses Problem gelöst, bitte aktualisieren Sie mich dazu. –