Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions Clustering/View/GDefaultClusterRenderer.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,19 @@ - (void)clustersChanged:(NSSet*)clusters {
for (GMSMarker *marker in _markerCache) {
marker.map = nil;
}

[_markerCache removeAllObjects];

for (id <GCluster> cluster in clusters) {
GMSMarker *marker;
marker = [[GMSMarker alloc] init];
[_markerCache addObject:marker];

NSUInteger count = cluster.items.count;
if (count > 1) {
marker = [[GMSMarker alloc] init];
marker.icon = [self generateClusterIconWithCount:count];
marker.position = cluster.marker.position;
} else {
marker = cluster.marker;
}
else {
marker.icon = cluster.marker.icon;
}

marker.userData = cluster.marker.userData;

marker.position = cluster.marker.position;
[_markerCache addObject:marker];
marker.map = _map;
}
}
Expand Down