This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
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.
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.
This change effectively moves the camera’s focal point closer to where it was prior to #14664. Unfortunately, just modifying
tangentOfFovAboveCenterAngle
probably causes thepitch
andcontentInsets
(edgePadding
) properties to become inaccurate or inconsistent. This would technically be a consideration for #15195 as well, but in that case it’s only an edge case with very large padding, whereas here it would affect the camera no matter the amount of padding.I agree that the pitch should vary by zoom level (#6908), but ideally it would be limited by the visible distance rather than a screen-based factor, and the pitch should be explicitly limited, affecting the camera model, not just the internal transform.
In the meantime, the common workaround for mapbox/mapbox-gl-native-android#162 is to reduce the pitch to something like 45°. That certainly isn’t optimal, but at least the map is internally consistent.
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.
Thanks for your feedback ! I understand that there is no easy solution, and this change would involve regressions for other use cases.
A separate, explicit parameterfor offset or for max visible distance sounds like a good idea, I hope it will be available at some time.
Actually the padding is not so "very large", it is easily reached if we want to have the map centered around 1/4 of the screen height.
The problem I have with reducing the pitch to 45° is that it doesn't take real padding size into account, sometimes it is not necessary to reduce the pitch so much. I think I will keep my "fix" in our fork while there is no alternative.