Skip to content

Stop updating location on map view - #343

Merged
frederoni merged 1 commit into
masterfrom
fred-stop-mapview-updates
Jul 12, 2017
Merged

frederoni merged 1 commit into
masterfrom
fred-stop-mapview-updates

Conversation

@frederoni

@frederoni frederoni commented Jul 7, 2017 •

Copy link
Copy Markdown
Contributor

Fixes #341

When an application is sent to the background and brought back to the foreground, MGLMapView calls -validateLocationServices and starts updating locations again.

This is easy to spot when using SimulatedLocationManager or ReplayLocationManager but not if you're using the DefaultLocationManager since the location will be exactly the same.

The fix in this PR works, however, I think a more appropriate solution would be to expose a manuallyUpdatesLocation (or similar) on MGLMapView that would leave location updating to the user. At the same time, we would also expose that MGLMapView conforms to CLLocationManagerDelegate so that you can feed MGLMapView with locations without using the workaround in https://github.com/mapbox/mapbox-navigation-ios/blob/master/MapboxNavigation/MGLMapView%2BMGLNavigationAdditions.h#L5

@1ec5 @bsudekum @ericrwolfe 👀

@frederoni frederoni added the ⚠️ DO NOT MERGE PR should not be merged! label Jul 7, 2017
@frederoni
frederoni requested review from 1ec5, bsudekum and ericrwolfe July 7, 2017 16:24
@bsudekum

bsudekum commented Jul 7, 2017

Copy link
Copy Markdown
Contributor

Deferring judgement to @1ec5 on this one.

@1ec5

1ec5 commented Jul 9, 2017

Copy link
Copy Markdown
Contributor

The fix in this PR works, however, I think a more appropriate solution would be to expose a manuallyUpdatesLocation (or similar) on MGLMapView that would leave location updating to the user.

This isn’t unreasonable, but between this change and mapbox/mapbox-gl-native#6867, I wonder how much we’re benefiting from the map SDK’s built-in course tracking functionality in the first place. #352 would move us off that built-in functionality in favor of a custom implementation that we’d have more control over.

@1ec5 1ec5 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 on this kludge in hopes of wiping it away as part of #352.

@frederoni
frederoni force-pushed the fred-stop-mapview-updates branch from 9377fd3 to 2484189 Compare July 12, 2017 12:03
@frederoni frederoni removed the ⚠️ DO NOT MERGE PR should not be merged! label Jul 12, 2017
@frederoni
frederoni merged commit 830724a into master Jul 12, 2017
@frederoni
frederoni deleted the fred-stop-mapview-updates branch July 12, 2017 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Navigation not working when app going to background and back to foreground.

3 participants