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

Rotate map based on heading while walking #1942

Closed
1ec5 opened this issue Jan 23, 2019 · 5 comments · Fixed by #3620
Closed

Rotate map based on heading while walking #1942

1ec5 opened this issue Jan 23, 2019 · 5 comments · Fixed by #3620
Assignees
Labels
feature New feature request. topic: location UI Work related to visual components, Android Auto, Camera, 3D, voice, etc.
Milestone

Comments

@1ec5
Copy link
Contributor

1ec5 commented Jan 23, 2019

When the user is walking, they can more easily turn around than when driving. It’s more important for the map to indicate the direction the user is facing than the direction they’re walking, in the event that they turn around to orient themselves. Essentially, MGLUserTrackingMode.trackWithHeading is more appropriate than MGLUserTrackingMode.trackWithCourse for the walking use case.

When the current step’s transportType is walking, the camera’s heading should be set to CLHeading.trueHeading, not CLLocation.course:

let newCamera = camera ?? MGLMapCamera(lookingAtCenter: location.coordinate, altitude: altitude, pitch: 45, heading: location.course)

/cc @mapbox/navigation-ios @lauri-rustanius

@1ec5 1ec5 added bug Something isn’t working topic: location labels Jan 23, 2019
@1ec5
Copy link
Contributor Author

1ec5 commented Jan 23, 2019

Note that, due to a map SDK limitation, this fix may cause location tracking to lag: mapbox/mapbox-gl-native#3625 (comment). So we may want to throttle rotation changes to allow the center coordinate to catch up, so to speak.

@akitchen akitchen added feature New feature request. and removed bug Something isn’t working labels Mar 28, 2019
@1ec5
Copy link
Contributor Author

1ec5 commented Apr 3, 2019

When we rely on CLHeading, we need to update CLLocationManager.headingOrientation whenever the device’s orientation changes. Otherwise, the heading could be up to 90° off whenever the user holds the phone in landscape orientation.

https://github.com/mapbox/mapbox-gl-native/blob/f3c3dc49e231208e75db64b53c5e92bb9647a661/platform/ios/src/MGLMapView.mm#L5865-L5905

@1ec5
Copy link
Contributor Author

1ec5 commented Aug 24, 2019

#2215 fixes this issue.

Note that, due to a map SDK limitation, this fix may cause location tracking to lag: mapbox/mapbox-gl-native#3625 (comment). So we may want to throttle rotation changes to allow the center coordinate to catch up, so to speak.

I’m inclined to treat this issue as tail work and piggyback on any forthcoming solution for mapbox/mapbox-gl-native#3625. I don’t think it’ll end up being a huge problem in practice, because walking speeds are so low compared to driving speeds.

@1ec5 1ec5 modified the milestones: v0.38.0, v0.39.0 Oct 2, 2019
@1ec5 1ec5 modified the milestones: v0.39.0, v1.0.0 Nov 26, 2019
@1ec5 1ec5 modified the milestones: v1.0.0, v0.x next Apr 14, 2020
@1ec5 1ec5 added the size: S label Apr 14, 2020
@1ec5 1ec5 removed this from the v0.40.0 milestone Apr 24, 2020
@stale
Copy link

stale bot commented Oct 21, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the archived Archived issue. label Oct 21, 2020
@stale
Copy link

stale bot commented Nov 2, 2020

Stale.

@stale stale bot closed this as completed Nov 2, 2020
@1ec5 1ec5 reopened this Nov 20, 2020
@stale stale bot removed the archived Archived issue. label Nov 20, 2020
@1ec5 1ec5 added the UI Work related to visual components, Android Auto, Camera, 3D, voice, etc. label May 28, 2021
@truburt truburt added this to the v2.0.0 (GA) milestone Jul 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request. topic: location UI Work related to visual components, Android Auto, Camera, 3D, voice, etc.
Projects
None yet
5 participants