summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Bounds <jesse@rebounds.net>2017-10-24 12:03:36 -0700
committerJesse Bounds <jesse@rebounds.net>2017-10-24 12:03:36 -0700
commitf119524945b8aec8eb8fd5e98453846f400193c6 (patch)
tree398279cc18efa188567a4018d4467eb3b629a62a
parent4b2e1cddb4645fb6d2c5f9634dbeb7c21516cede (diff)
downloadqtlocation-mapboxgl-upstream/boundsj-dispatch-scalebar-updates.tar.gz
[ios] Asynchronously dispatch scale bar updates on camera updatesupstream/boundsj-dispatch-scalebar-updates
-rw-r--r--platform/ios/src/MGLMapView.mm4
1 files changed, 3 insertions, 1 deletions
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index 0e76c0c71c..9d9fd7005a 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -5071,7 +5071,9 @@ public:
[self updateCompass];
if (!self.scaleBar.hidden) {
- [(MGLScaleBar *)self.scaleBar setMetersPerPoint:[self metersPerPointAtLatitude:self.centerCoordinate.latitude]];
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [(MGLScaleBar *)self.scaleBar setMetersPerPoint:[self metersPerPointAtLatitude:self.centerCoordinate.latitude]];
+ });
}
if ([self.delegate respondsToSelector:@selector(mapViewRegionIsChanging:)])