Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I would suggest a couple of things. One, look at the method <code>annotationsInMapRect:</code>. According to the docs, it says: </p> <blockquote> <p>This method offers a fast way to retrieve the annotation objects in a particular portion of the map. This method is much faster than doing a linear search of the objects in the annotations property yourself.</p> </blockquote> <p>Two, look at <code>dequeueReusableAnnotationViewWithIdentifier:</code>. According to the docs again, it says:</p> <blockquote> <p>For performance reasons, you should generally reuse MKAnnotationView objects in your map views. As annotation views move offscreen, the map view moves them to an internally managed reuse queue. As new annotations move onscreen, and your code is prompted to provide a corresponding annotation view, you should always attempt to dequeue an existing view before creating a new one. Dequeueing saves time and memory during performance critical operations such as scrolling.</p> </blockquote> <p>Finally, a couple of thoughts. Instead of doing these changes every time the <code>- (void)mapView:(MKMapView *)_mapView regionDidChangeAnimated:(BOOL)animated</code> method is called, how about doing it according to some other rule (such as after a timer gets fired [make sure to reset the timer every time this gets called])? Another thing to consider: how about grouping annotations together that are super close to each other? Let's say you're zoomed out to where Rhode Island looks super small, maybe just a dozen pixels wide, and you have 100 points in Rhode Island -- you should just display one pin.</p> <p>Hope this helps!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload