This repository was archived by the owner on Aug 8, 2023. It is now read-only.
MGLMapView calls MGLMapViewDelegate 'viewForAnnotation:' for annotations outside visible area #6173
Labels
annotations
Annotations on iOS and macOS or markers on Android
bug
iOS
Mapbox Maps SDK for iOS
performance
Speed, stability, CPU usage, memory usage, or power usage
Platform: iOS
Mapbox SDK version: 3.3.4
Steps to trigger behavior
Expected behavior
No annotations are visible on the map or nowhere near the borders of visible area, MGLMapView should not(?) call method:
**'- (MGLAnnotationView )mapView:(MGLMapView )mapView viewForAnnotation:(id)annotation'
Why? Because there's no annotations visible.
Actual behavior
**'- (MGLAnnotationView )mapView:(MGLMapView )mapView viewForAnnotation:(id)annotation' is called constantly while panning on the map while there are no annotations nowhere near the visible area.
Below is the callstack.
In a nutshell 'MGLMapView notifyMapChange:' method is called with param MapChangeDidFinishRenderingFrameFullyRendered which triggers a update for all annotations(?)
Why is this a problem?
The map becomes very unresponsive with large amount of MGLAnnotationView objects placed on the map. I feel like the annotation view reuse queue is not working like it is intended to work.
The text was updated successfully, but these errors were encountered: