Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pin Annotations Not dequeue if small number #53

Open
matcodes opened this issue Aug 17, 2016 · 4 comments
Open

Pin Annotations Not dequeue if small number #53

matcodes opened this issue Aug 17, 2016 · 4 comments

Comments

@matcodes
Copy link

I have various number of annotations come from server. Annotations number range could be from 3 up to 1300. I was testing edge cases, where I have 3 annotations, and dequeueWithIdentifier for map view always returns me nil and that's why new pinView is added every time.

image-17-08-16-01-36

@samuel-gallet
Copy link

If your annotations are still visible on the map, the dequeueReusableAnnotationViewWithIdentifier will always return nil, because there are no annotations to reuse.
The dequeueReusableAnnotationViewWithIdentifier use the annotationViews offscreen to display the annotations visible on the map

@matcodes
Copy link
Author

matcodes commented Aug 17, 2016

@samuel-gallet At first launch it shows one annotationView per annotation, when i scroll the map to the locations where pins are not on the map, when I come back there is one new added. On screenshot you see the result after 7-8 such operations. I do not call dequeueReusableAnnotationViewWithIdentifier manually, it is being triggered when I go to the target location which is visible on the map.

@matcodes
Copy link
Author

Here is an expected behavior, if I use addNonClusteredAnnotation: method instead of setAnnotations: dequeReusable returns me always non-nil view
image-17-08-16-02-12

@samuel-gallet
Copy link

Can you give an example of how you are using the library? Indeed, everything looks fine for me. You can try our demo project, the dequeueReusableAnnotationViewWithIdentifier method does not return nil value when called in the ADClusterMapView delegate method:

  • (MKAnnotationView *)mapView:(ADClusterMapView *)mapView
    viewForClusterAnnotation:(id)annotation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants