Skip to content

Commit

Permalink
Dispatch to main queue, rather than global, fixes maplibre#59
Browse files Browse the repository at this point in the history
  • Loading branch information
reezer authored Apr 14, 2021
1 parent d716b5b commit ffa1098
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion platform/ios/platform/ios/src/MGLMapView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -6026,7 +6026,7 @@ - (void)dismissHeadingCalibrationDisplay:(id<MGLLocationManager>)manager

- (void)locationManager:(__unused id<MGLLocationManager>)manager didUpdateHeading:(CLHeading *)newHeading
{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void) {
dispatch_async(dispatch_get_main_queue(), ^(void) {
if ( ! self->_showsUserLocation || self.pan.state == UIGestureRecognizerStateBegan || newHeading.headingAccuracy < 0) return;

self.userLocation.heading = newHeading;
Expand Down

0 comments on commit ffa1098

Please sign in to comment.