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

User puck rotation should account for horizontal content insets #1681

Closed
1ec5 opened this issue Sep 13, 2018 · 2 comments · Fixed by #1845
Closed

User puck rotation should account for horizontal content insets #1681

1ec5 opened this issue Sep 13, 2018 · 2 comments · Fixed by #1845
Assignees
Labels
bug Something isn’t working CarPlay Bugs, improvements and feature requests on Apple CarPlay topic: design
Milestone

Comments

@1ec5
Copy link
Contributor

1ec5 commented Sep 13, 2018

When tracking the user’s course, UserCourseView’s arrow points in a direction determined by a CLHeading object, assuming that UserCourseView is located above the visual center of the map view, and that map’s vanishing point is located directly above UserCourseView. When the map view has a left or right content inset, the route line and UserCourseView are shifted to the side, while the map’s vanishing point remains horizontally centered due to mapbox/mapbox-gl-native#12728.

For example, in CarPlay, there is a wide content inset on the driver’s side to accommodate maneuver panels. When both the route and the user go due north, the route line is slanted towards the driver’s side while UserCourseView’s arrow nonetheless points straight up.

The 3D transform for UserCourseView’s arrow needs to account for horizontal content insets. The correction might end up depending on the pitch. As with mapbox/mapbox-gl-native#5245, it may be necessary to fudge the transform matrix’s m34.

/cc @mapbox/navigation-ios @d-prukop

@1ec5 1ec5 added bug Something isn’t working topic: design CarPlay Bugs, improvements and feature requests on Apple CarPlay labels Sep 13, 2018
@1ec5 1ec5 self-assigned this Sep 13, 2018
@akitchen akitchen added this to the v0.22.0 milestone Sep 18, 2018
@1ec5
Copy link
Contributor Author

1ec5 commented Sep 29, 2018

As with mapbox/mapbox-gl-native#5245, it may be necessary to fudge the transform matrix’s m34.

This would be the most correct fix, but for this issue it’s sufficient to just adjust the puck’s rotation without worrying about the rest of the transform matrix. We’re only talking about the rotation of a single shape, and the puck looks weird anyways when it isn’t a circle. Fixing that broader issue would require mapbox/mapbox-gl-native#10498 or even mapbox/mapbox-navigation-ios-examples#9.

@1ec5 1ec5 modified the milestones: v0.22.0, v0.23.0 Sep 29, 2018
@1ec5 1ec5 modified the milestones: v0.23.0, v0.24.0 Oct 24, 2018
@1ec5 1ec5 modified the milestones: v0.24.0, v0.25.0 Nov 7, 2018
@1ec5
Copy link
Contributor Author

1ec5 commented Nov 20, 2018

The more fundamental issue is that the map view’s vanishing point remains in the logical center instead of shifting to accommodate the content insets. That is, the arrow is pointing in the right direction, but the map has the wrong perspective. For example, this segment of the route line goes straight ahead until the maneuver, so it should be a vertical line on the screen instead of being slanted:

vanishing

The most common workaround is to extend the opposite side of the map view off the right side of the screen to counterbalance the left content inset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working CarPlay Bugs, improvements and feature requests on Apple CarPlay topic: design
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants