You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
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
annotationsAnnotations on iOS and macOS or markers on AndroidbugiOSMapbox Maps SDK for iOSperformanceSpeed, stability, CPU usage, memory usage, or power usage
Build & run Mapbox iOS example app located at 'platform/ios/ios.xcodeproj'
Click 'gear' icon on top left corner to open Map Settings menu
Click 'Add 100 Views' to add annotations to map
Pan map so annotations are outside the visible map area.
Keep panning into areas with no annotations
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.
changed the title [-]MGLMapViewDelegate calls viewForAnnotation: for annotations outside visible area[/-][+]MGLMapView calls MGLMapViewDelegate 'viewForAnnotation:' for annotations outside visible area[/+]on Aug 26, 2016
annotationsAnnotations on iOS and macOS or markers on AndroidbugiOSMapbox Maps SDK for iOSperformanceSpeed, stability, CPU usage, memory usage, or power usage
Activity
[-]MGLMapViewDelegate calls viewForAnnotation: for annotations outside visible area[/-][+]MGLMapView calls MGLMapViewDelegate 'viewForAnnotation:' for annotations outside visible area[/+]1ec5 commentedon Aug 26, 2016
Related: #5787 (comment)
/cc @boundsj @incanus
boundsj commentedon Nov 1, 2016
This is fixed in #5987. #5987 will be in the next release (beta 2).