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

[ios] Disable region monitoring when stopping location monitoring #7833

Conversation

JesseCrocker
Copy link
Contributor

See #7831 for description

@mention-bot
Copy link

@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) {
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

@boundsj boundsj left a 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

@1ec5 1ec5 added iOS Mapbox Maps SDK for iOS telemetry Integration with Mapbox Telemetry libraries bug labels Jan 24, 2017
@1ec5 1ec5 added this to the ios-v3.5.0 milestone Jan 24, 2017
@1ec5
Copy link
Contributor

1ec5 commented Jan 24, 2017

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.

@JesseCrocker
Copy link
Contributor Author

@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

@boundsj
Copy link
Contributor

boundsj commented Jan 24, 2017

@JesseCrocker master / 3.5.0 is 👍

@1ec5
Copy link
Contributor

1ec5 commented Jan 24, 2017

v3.5.0 is more straightforward, since any changes to telemetry require significant testing. 👍

* 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.
Copy link
Contributor

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.

@@ -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))
Copy link
Contributor

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”.

@boundsj
Copy link
Contributor

boundsj commented Feb 16, 2017

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.

@JesseCrocker
Copy link
Contributor Author

@boundsj Thats already enabled, and you pushed to my branch 18 hours ago.

@boundsj
Copy link
Contributor

boundsj commented Feb 16, 2017

Thanks! Must be something wrong on my side so I'll check and try again.

you pushed to my branch 18 hours ago.

That was actually me experimenting with GitHub's resolve conflicts button 😄

@boundsj boundsj force-pushed the disable-region-monitor-when-disabling-location branch from 3d7bb1c to cf0ba87 Compare February 16, 2017 20:33
@boundsj
Copy link
Contributor

boundsj commented Feb 16, 2017

Yeah, sorry @JesseCrocker. Just an auth issue. Merging now. 👍

@boundsj boundsj merged commit d4c569a into mapbox:master Feb 16, 2017
@JesseCrocker JesseCrocker deleted the disable-region-monitor-when-disabling-location branch March 3, 2017 13:44
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 telemetry Integration with Mapbox Telemetry libraries
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants