Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[iOS] Tracking course when mode is .follow #8270

Closed
eimantas opened this issue Mar 3, 2017 · 2 comments
Closed

[iOS] Tracking course when mode is .follow #8270

eimantas opened this issue Mar 3, 2017 · 2 comments
Labels
feature iOS Mapbox Maps SDK for iOS

Comments

@eimantas
Copy link
Contributor

eimantas commented Mar 3, 2017

Platform: iOS
Mapbox SDK version: iOS 3.4.2

How would I go about implementing user's course tracking when the tracking mode is .follow? The MGLUserLocationAnnotationView class that I subclass does not contain the userLocation property (it is set only when the tracking mode is .followWithHeading). But regardless of the tracking mode (with exception to .none) framework could provide the direction, heading and course data on the annotation view.

The reason I need this is to display the "north-up" map view with rotating user's annotation view. I could work around this by weakly capturing the user's annotation view and setting the custom course property on it and then leaving it to the framework to call update() but that doesn't feel as a clean solution to my problem.

Any advice is much appreciated.

@eimantas eimantas changed the title Tracking course when mode is .follow [iOS] [macOS] Tracking course when mode is .follow Mar 3, 2017
@friedbunny friedbunny added feature iOS Mapbox Maps SDK for iOS labels Mar 3, 2017
@friedbunny
Copy link
Contributor

You should be able to access MGLUserLocationAnnotationView.userLocation.location.course in any active tracking mode. Here is how we update the user location annotation in .followWithCourse, but this should be equally applicable in other modes.

(I verified this using our custom dot example in iosapp.)

Heading is not yet available outside of .followWithHeading — enabling it in other tracking modes is planned in #5523.

@friedbunny friedbunny changed the title [iOS] [macOS] Tracking course when mode is .follow [iOS] Tracking course when mode is .follow Mar 3, 2017
@friedbunny
Copy link
Contributor

Note that the addition of MGLUserTrackingMode to our macOS SDK was mistaken — it’s being made exclusive to iOS in #8141. There is not yet any concept of user location in our macOS SDK.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

No branches or pull requests

3 participants