-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[ios] Disable region monitoring when stopping location monitoring #7833
[ios] Disable region monitoring when stopping location monitoring #7833
Conversation
@JesseCrocker, thanks for your PR! By analyzing this pull request, we identified @1ec5, @boundsj and @incanus to be potential reviewers. |
@@ -46,6 +46,11 @@ - (void)stopUpdatingLocation { | |||
[self.delegate locationManagerDidStopLocationUpdates:self]; | |||
} | |||
} | |||
if(self.standardLocationManager.monitoredRegions.count > 0) { | |||
for(CLRegion *region in self.standardLocationManager.monitoredRegions) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since monitoredRegions are a shared resource we should only call stopMonitoringForRegion:
on the (at most) one region this class creates for itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops! I see that is happening just below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. For cases where telemetry is paused I think this change makes sense. However we should be careful not to stop the monitoring of regions that were not created by MGLLocationManager
Placing this PR on the v3.5.0 milestone because it targets the master branch. If v3.4.x is desired, please retarget and rebase onto the release-ios-v3.4.0 branch. |
@1ec5 Im off on my own branch, not building off current release branches, so the target doesn't matter too much to me, but i'll happily change the target if you want it 3.4.x |
@JesseCrocker master / 3.5.0 is 👍 |
v3.5.0 is more straightforward, since any changes to telemetry require significant testing. 👍 |
platform/ios/CHANGELOG.md
Outdated
* Added a `MGLDistanceFormatter` class for formatting geographic distances. ([#7888](https://github.com/mapbox/mapbox-gl-native/pull/7888)) | ||
* Added a method to MGLMapViewDelegate, `-mapView:shouldChangeFromCamera:toCamera:`, that you can implement to restrict which parts the user can navigate to using gestures. ([#5584](https://github.com/mapbox/mapbox-gl-native/pull/5584)) | ||
* Annotations are no longer deselected when the map is panned or zoomed, even if the annotation moves out of the visible bounds. ([#8022](https://github.com/mapbox/mapbox-gl-native/pull/8022)) | ||
* Double-tap and two-finger tap gestures now zoom to the nearest integer zoom level. ([#8027](https://github.com/mapbox/mapbox-gl-native/pull/8027)) | ||
* Fixed an issue that was causing system location indicator to stay on in background after telemetry was disabled. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link to this PR here.
platform/ios/CHANGELOG.md
Outdated
@@ -39,10 +39,12 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT | |||
* Fixed an issue that, among other things, caused various islands to disappear at certain zoom levels. ([#7621](https://github.com/mapbox/mapbox-gl-native/pull/7621)) | |||
* Fixed an issue where translucent, non-view-backed point annotations along tile boundaries would be drawn darker than expected. ([#6832](https://github.com/mapbox/mapbox-gl-native/pull/6832)) | |||
* Fixed flickering that occurred when panning past the antimeridian. ([#7574](https://github.com/mapbox/mapbox-gl-native/pull/7574)) | |||
* Fixed an issue that could prevent a cached style from appearing while the device is offline. ([#7770](https://github.com/mapbox/mapbox-gl-native/pull/7770)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line already appears above, under “Networking and offline maps”.
Thanks again for making this PR @JesseCrocker. On https://github.com/mapbox/mapbox-gl-native/tree/disable-region-monitor-when-disabling-location, I've squashed your commits and pushed them up in a branch with the same name to get the build bots to run (they did and are all 🍏 ). Can you please allow commits from me to the branch on your fork? That'll allow me to sync my branch and yours and it should cause this PR to be automatically closed when I merge. |
@boundsj Thats already enabled, and you pushed to my branch 18 hours ago. |
Thanks! Must be something wrong on my side so I'll check and try again.
That was actually me experimenting with GitHub's resolve conflicts button 😄 |
3d7bb1c
to
cf0ba87
Compare
Yeah, sorry @JesseCrocker. Just an auth issue. Merging now. 👍 |
See #7831 for description