Update annotation views before informing delegate#5287
Conversation
On each frame update, update annotation views before informing the delegate of the new frame. This allows the delegate to manipulate annotation views without fear of the SDK overriding those modifications.
|
/cc: @ivovandongen |
|
If the developer needs the previous behavior, in which the delegate gets notified before MGLMapView arranges its MGLAnnotationViews, MGLMapViewDelegate can implement |
|
👍 |
|
@1ec5 Please note that this approach is extremely risky as the Moreover, in the SDK you already move to the front the selected annotation if it sits behind the other ones. Please consider exposing this to the map view interface. |
This change is unrelated to how MGLAnnotationView gets used or reused. Instead of holding a strong reference to the view in application code, consider calling
Are you referring to the functionality added in #5264? Please feel free to open a new issue requesting a public API for controlling it; I’m not quite sure what kind of configurability you’re looking for. |
On each frame update, update annotation views before informing the delegate of the new frame. This allows the delegate to manipulate annotation views without fear of the SDK overriding those modifications.
For example, if you want a particular view-backed annotation other than the selected annotation to appear in front of any other view-backed annotations, your MGLMapViewDelegate can hold a strong reference to the view it provides for that annotation and implement this method:
/ref #991 #5264
/cc @frederoni @boundsj @zugaldia