Repository navigation
Conversation
Sets the annotation's symbol-sort-key, so overlapping point annotations can be drawn in a chosen order without sorting them. Adds the Point Annotation Priority example.
This branch was successfully deployed
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Added
prioritytoPointAnnotation, which sets the order overlapping point annotations are drawn in.Motivation
PointAnnotations overlap, apps can't choose which one is drawn on topprioritylets an app set the drawing order directly: higher priority annotations are drawn above lower priority onesMarkerView#priorityfrom feat(MarkerView): add priority, minZoom, maxZoom and allowZElevate #4394. That one picks which marker wins a collision. This one picks which annotation is drawn on top, since point annotations always allow overlap.prioritykeep the order they have today on both platformsChanges
priorityprop: onPointAnnotationand its native spec, documented in the generated docs. It's unset by default.symbolSortKey. Whenpriorityis unset, the sort key stays unset, so iOS keeps ordering annotations by their position on screen.symbolSortKey, which used to be a fixed 10 for every annotation. Unset now means 0, so annotations without a priority keep the same order. Callouts still use 11, so they stay above annotations unless an annotation's priority is above 11.Checklist
CONTRIBUTING.mdyarn generatein the root folder/exampleapp./example)Testing
yarn type:check,yarn lintandyarn generateScreenshot OR Video
In the example screen, showing the red annotation with priority 1, then the blue annotation with priority 1.