This repository was archived by the owner on Aug 8, 2023. It is now read-only.
[ios] Add annotation container view#5148
Closed
boundsj wants to merge 2 commits into
Closed
Conversation
This adds an option to MGLAnnotationView so that a developer can control how their annotation views scale in size as they approach the top of the map view (along the Y axis). The size change is also affected by the pitch (tilt) of the map view. If there is no tilt then scaling is not performed. As the map is tilted scaling is gradually applied. This turns the MGLAnnotationView implementation into an Objective C++ class so that SDK constants from C++ files can be used. The new behavior is enabled by default to maintain consistency with annotations backed by GL sprites. The MBXViewController redundantly sets the new property as an illustration of use.
| { | ||
| annotationView = [[MBXAnnotationView alloc] initWithReuseIdentifier:MBXViewControllerAnnotationViewReuseIdentifer]; | ||
| annotationView.frame = CGRectMake(0, 0, 40, 40); | ||
| annotationView.frame = CGRectMake(0, 0, 10, 10); |
Contributor
There was a problem hiding this comment.
MBXAnnotationView is also used for dropped pins, but this is kind of small for that demo. Let’s stop using an annotation view for dropped pins, so we get better visibility on GL annotations, which are still supported. MBXAnnotationView would continue to be used for other demos like “Add n Point Annotations”.
c6ae08c to
4b3c26b
Compare
Contributor
|
The saga continues in #5194. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #5140
Fixes #5089
Adds a new UIView subclass to contain MGLAnnotationView instances and an API for helping to manage the addition of new annotations. To mitigate known performance issues with
UIView:addSubview:, this batches up the addition of subviews to the container before adding the container itself to the view hierarchy. The organization of the views in the separate container also naturally avoids the "piercing" issue seen before between annotations and callouts.