mapbox / mapbox-gl-native

Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL
https://mapbox.com/mobile
Other
4.37k stars 1.32k forks source link

Perform user tracking even with the user location annotation is not visible. #5598

Open boundsj opened 8 years ago

boundsj commented 8 years ago

For parity with MapKit, showsUserLocation and userTrackingMode should work independently so that the map will update according to the behavior defined by each MGLUserTrackingMode value even if the user annotation is not shown. This implies that the SDK would trigger the Core Location permissions dialog (like it currently does when showsUserLocation is set to true), if required, when userTrackingMode is set to a mode that requires it.

The user tracking modes MGLUserTrackingModeFollow, MGLUserTrackingModeFollowWithHeading, and, MGLUserTrackingModeFollowWithCourse.

incanus commented 8 years ago

Wow, surprised Apple MapKit does this!

1ec5 commented 6 years ago

As far as I can tell, the fix would be to remove these lines:

https://github.com/mapbox/mapbox-gl-native/blob/cb1f781a1897826ea69eb9787ea4a059686450d9/platform/ios/src/MGLMapView.mm#L4958-L4960

and conditionalize this line on the userTrackingMode:

https://github.com/mapbox/mapbox-gl-native/blob/cb1f781a1897826ea69eb9787ea4a059686450d9/platform/ios/src/MGLMapView.mm#L5109

stale[bot] commented 5 years ago

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

stale[bot] commented 5 years ago

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.