-
Notifications
You must be signed in to change notification settings - Fork 1.3k
refs 654f015: bring back sprite-backed annotation option for comparison #5786
Conversation
@incanus, thanks for your PR! By analyzing the annotation information on this pull request, we identified @1ec5, @friedbunny and @boundsj to be potential reviewers |
Removed unused annotation image code from iosapp, now that bulk-added point annotations are backed by annotation views.
@@ -301,6 +316,7 @@ - (void)parseFeaturesAddingCount:(NSUInteger)featuresCount | |||
MGLPointAnnotation *annotation = [MGLPointAnnotation new]; | |||
annotation.coordinate = coordinate; | |||
annotation.title = title; | |||
annotation.subtitle = [NSString stringWithFormat:@"View: %i", useViews]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using a magic string to detect a view-backed annotation, subclass MGLPointAnnotation and check whether it’s a kind of that subclass below. The class check is slightly more efficient than a string comparison and more self-documenting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, was thinking about that but trying to avoid overhead of a class. Probably a good idea, though.
Merged manually into Sorry, forgot the |
Forgot to force push this into the branch after rebase; remedied as of 4e61b2e. |
Background in 654f015#commitcomment-18366764.
We should have sprite-backed annotations as an option still for comparison to view-backed until such time that view-backed performance is equal or of negligible difference.
This more or less reverses 654f015, though it doesn't bring back
-mapView:didDeselectAnnotation:
, of which I'm not sure what the point was—something about changing to pins if we don't have a sprite to reuse? Open to feedback here.Subjectively, since last being in this code, I am noticing a pretty marked performance decrease for annotation sprites, possibly related to z-ordering that I see happening during map rotation. Might be something else. I'm going to profile out of curiosity separately from this—this PR is just about the functionality. But these should be a lot faster.
/cc @1ec5 @boundsj