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

Unable to turn on user location tracking immediately at startup #1145

Closed
1ec5 opened this issue Mar 27, 2015 · 6 comments · Fixed by #3680
Closed

Unable to turn on user location tracking immediately at startup #1145

1ec5 opened this issue Mar 27, 2015 · 6 comments · Fixed by #3680
Labels
bug iOS Mapbox Maps SDK for iOS

Comments

@1ec5
Copy link
Contributor

1ec5 commented Mar 27, 2015

Currently it doesn’t seem possible for an app to turn on MGLUserTrackingModeFollowWithHeading at startup, because -[MGLMapView setUserTrackingMode:animated:] goes and resets the mode to MGLUserTrackingModeNone if self.userLocation.coordinate is invalid. The coordinate is invalid from startup until we receive the first location update. And setting MGLUserTrackingModeFollow at startup doesn’t quite work either: we pan and zoom to the current location but immediately stop following after that.

@1ec5 1ec5 added bug iOS Mapbox Maps SDK for iOS labels Mar 27, 2015
@1ec5
Copy link
Contributor Author

1ec5 commented Mar 27, 2015

The workaround is to first set a valid center coordinate. That’s a pretty sensible workaround, so I don’t think this bug is important for beta 1.

@incanus
Copy link
Contributor

incanus commented Apr 6, 2015

Pretty sure this is obsolete, but needs testing.

@1ec5
Copy link
Contributor Author

1ec5 commented Apr 6, 2015

Still reproduces. Without setting a center coordinate, set the user tracking mode. Nothing happens.

@1ec5
Copy link
Contributor Author

1ec5 commented Jan 26, 2016

This is probably stale now, given that -commonInit does set a center coordinate these days.

@friedbunny
Copy link
Contributor

Tried this on #3680's branch — plain follow is now possible, but heading and course modes both knock down to follow because the heading isn't valid yet.

@1ec5
Copy link
Contributor Author

1ec5 commented Jan 27, 2016

heading and course modes both knock down to follow because the heading isn't valid yet.

A fix is ready in #3680.

1ec5 added a commit that referenced this issue Jan 27, 2016
Entering user tracking mode at launch now zooms in and shows the user dot or user puck. The user dot’s heading indicator now points in the correct direction during the animation to the initial location. Course changes are reflected immediately even in the absence of location changes.

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

Successfully merging a pull request may close this issue.

3 participants