Comments (2)
Hi Simon,
All annotations added to the MKMapView
are of type CCHMapClusterAnnotation
– whether there's one or several custom annotations inside the cluster.
Something like this will work:
NSMutableArray *rootAnnotations = [NSMutableArray array];
NSSet *annotations = [self.mapView annotationsInMapRect:self.mapView.visibleMapRect];
for (id<MKAnnotation> annotation in annotations) {
if ([annotation isKindOfClass:CCHMapClusterAnnotation.class]) {
CCHMapClusterAnnotation *clusterAnnotation = (CCHMapClusterAnnotation *)annotation;
[rootAnnotations addObjectsFromArray:clusterAnnotation.annotations.allObjects];
}
}
NSLog(@"%tu", rootAnnotations.count);
-Claus
from cchmapclustercontroller.
Thanks. Led me in the right direction!
from cchmapclustercontroller.
Related Issues (20)
- Annotation views occasionally disappear while panning/zooming HOT 2
- willReuseMapClusterAnnotation does not work in Swift HOT 6
- showAnnotations:animated: adds the default pin instead of custom Annotation Views HOT 1
- Using own custom MKAnnotation subclass for uniqueLocations HOT 4
- Strange behavior when zooming in and out HOT 14
- Two markers at exact same location HOT 1
- How to get the instance of CCHMapClusterAnnotation? HOT 4
- Crash due to usage of KVO HOT 5
- Annotations and clusters get removed randomly when using MKMapTypeHybridFlyover HOT 7
- Cannot refer to custom subclass of MKAnnotation in viewForAnnotation HOT 3
- Cannot tap on Annotation View
- Can't see annotation while too zoomed out HOT 4
- Annotation coordinate is not properly updated HOT 2
- Displaying different annotation views HOT 1
- Make the representation of ClusterAnnotationView unchanged when zooming in or out HOT 5
- changing the annotation view when isUnique changes HOT 2
- Getting wrong annotation count on click of cluster in swift 3 HOT 1
- TV OS? HOT 1
- Removing Annotations doesn't work correctly HOT 6
- Is it possible for clusters to have sub clusters?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cchmapclustercontroller.