Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Annotations so that the gesture recognizer is managed by the AnnotationOrchestrator #840

Merged
merged 8 commits into from
Nov 16, 2021

Conversation

jmkiley
Copy link
Contributor

@jmkiley jmkiley commented Nov 16, 2021

PRs must be submitted under the terms of our Contributor License Agreement CLA.

Fixes: < Link to related issues that will be fixed by this pull request, if they exist >

Pull request checklist:

  • Briefly describe the changes in this PR.
  • Apply changelog label ('breaking change', 'bug 🪲', 'build', 'docs', 'feature 🍏', 'performance ⚡', 'testing 💯') or use the label 'skip changelog'
  • Add an entry inside this element for inclusion in the mapbox-maps-ios changelog: <changelog></changelog>.

Summary of changes

This PR:

  • Moves the *AnnotationManager.handleTap(_:) method to the AnnotationOrchestrator.
  • Updates the AnnotationManagerInternal protocol to include a delegate property and handleQueriedFeatures() method.
  • The *AnnotationManager.handleQueriedFeatures(_:) method takes an array of layer ID strings from AnnotationOrchestrator.handleTap(_:). If any of annotations for that manager have that ID, we will call the appropriate delegate method.

User impact (optional)

This is so features are queried only once per tap, even with multiple annotation managers.

@jmkiley jmkiley added the feature 🍏 When working on a new feature or feature enhancement label Nov 16, 2021
@jmkiley jmkiley self-assigned this Nov 16, 2021
Co-authored-by: Andrew Hershberger <andrew.hershberger@mapbox.com>
@jmkiley jmkiley marked this pull request as ready for review November 16, 2021 20:21
func destroy()

/// Passes an array of feature IDs to the `AnnotationInteractionDelegate.annotationManager(_:didDetectTappedAnnotations:)` delegate method.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd either remove this line since it's for an internal method or say something like "allows distributing results of query rendered features to annotation managers"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 🍏 When working on a new feature or feature enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants