This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
[ios] Always show annotation view even when view reuse is not used #6485
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes an issue noted in #6458 (comment) where the map view would drop annotation views
if the developer did not make full use of the reuse queue.
The fixes are:
viewReuseIdentifier
. Previously, if the app developer created a new annotation view with no reuse id each time[MGLMapViewDelegate mapView:viewForAnnotation:]
was called and then the view was scrolled offscreen, we attempted to add the view to the reuse queue (for no good reason) and did not update the views center ever again. This change avoids the reuse queue and just updates thecenter always.
[MGLMapViewDelegate mapView:viewForAnnotation:]
was called,and then if the annotation was scrolled off and then on screen again, we did not add the new view to the container view because it was not happening in the normal
addAnnotation
cycle. This adds add logic to catch that case and add annotation views created in this way to the view.Nonte that it is still advisable to use the resuse queue as shown in our annotation view example. Also, once #6055 lands, we will be able to clean this up even more. But, for now, this restores the unoptimized annotation view functionality that I think we were unintentionally not supporting.
cc @incanus @1ec5 @frederoni