On Jun 26, 2012, at 7:38 PM, Joe Wollard wrote: > Out of curiosity, why are you manually removing them in the first place? > MKMapView should be handling that logic for you as I understand it. If its > for performance, the docs say to make sure you dequeue the MKAnnotationView > instead of creating a new one when possible so that it can reuse the views > intelligently. > > Im working on a problem where I've got around 30-40k annotations on the map > and of course performance is terrible when they are all visible at the same > time. I'm looking into ways to only drop one pin per x pixels so that fewer > pins that are near each other are visible when zoomed out and more pins are > visible when zoomed in. If that's similar to the problem you're trying to > address, I'd be interested in your findings as I can't seem to come up with > anything that doesn't involve a bunch of overhead and rect calculations.
Check out the "Visualizing Information Geographically with MapKit" 2011 WWDC video. I believe it is in one of the demos that one approach to this EXACT issue is presented. You can also structure your annotations in a manner so as to make finding the right annotation(s) to display in a region easy (or, at least, computationally inexpensive). For example, look at quadtrees (e.g. http://blog.notdot.net/2009/11/Damn-Cool-Algorithms-Spatial-indexing-with-Quadtrees-and-Hilbert-Curves). -- Conrad Shultz _______________________________________________ Cocoa-dev mailing list ([email protected]) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
