summaryrefslogtreecommitdiff
path: root/platform/macos
diff options
context:
space:
mode:
Diffstat (limited to 'platform/macos')
-rw-r--r--platform/macos/CHANGELOG.md2
-rw-r--r--platform/macos/src/MGLMapView.mm40
2 files changed, 20 insertions, 22 deletions
diff --git a/platform/macos/CHANGELOG.md b/platform/macos/CHANGELOG.md
index 9f71a9c003..b4e2948a0a 100644
--- a/platform/macos/CHANGELOG.md
+++ b/platform/macos/CHANGELOG.md
@@ -18,7 +18,7 @@
* Fixed an issue preventing nested key path expressions get parsed accordingly to the spec. ([#11959](https://github.com/mapbox/mapbox-gl-native/pull/11959))
* Fixed race conditions that could cause crashes when re-using `MGLMapSnapshotter` or using multiple snapshotters at the same time. ([#11831](https://github.com/mapbox/mapbox-gl-native/pull/11831))
* Fixed crash in `-[MGLStyle localizeLabelsIntoLocale:]` on iOS 9.3 (attempting to access a property that was introduced in iOS 10.0 and used in Darwin code) ([#12123](https://github.com/mapbox/mapbox-gl-native/pull/12123))
-
+* Improved performance in view controllers that contain `MGLMapView`s. ([#12144](https://github.com/mapbox/mapbox-gl-native/pull/12144))
## 0.7.1
diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm
index bc9ac1e641..5d616c2c12 100644
--- a/platform/macos/src/MGLMapView.mm
+++ b/platform/macos/src/MGLMapView.mm
@@ -298,6 +298,7 @@ public:
[self installLogoView];
[self installAttributionView];
[self installGestureRecognizers];
+ [self installConstraints];
// Set up annotation management and selection state.
_annotationImagesByIdentifier = [NSMutableDictionary dictionary];
@@ -510,6 +511,23 @@ public:
multiplier:1
constant:8]];
}
+
+ // Place the attribution view to the right of the logo view and size it to
+ // fit the buttons inside.
+ [self addConstraint:[NSLayoutConstraint constraintWithItem:_logoView
+ attribute:NSLayoutAttributeBaseline
+ relatedBy:NSLayoutRelationEqual
+ toItem:_attributionView
+ attribute:NSLayoutAttributeBaseline
+ multiplier:1
+ constant:_logoView.image.alignmentRect.origin.y]];
+ [self addConstraint:[NSLayoutConstraint constraintWithItem:_attributionView
+ attribute:NSLayoutAttributeLeading
+ relatedBy:NSLayoutRelationEqual
+ toItem:_logoView
+ attribute:NSLayoutAttributeTrailing
+ multiplier:1
+ constant:8]];
}
- (void)dealloc {
@@ -704,7 +722,7 @@ public:
}
}
-- (void)updateConstraints {
+- (void)installConstraints {
// Place the zoom controls at the lower-right corner of the view.
[self addConstraint:
[NSLayoutConstraint constraintWithItem:self
@@ -760,25 +778,6 @@ public:
attribute:NSLayoutAttributeLeading
multiplier:1
constant:MGLOrnamentPadding - _logoView.image.alignmentRect.origin.x]];
-
- // Place the attribution view to the right of the logo view and size it to
- // fit the buttons inside.
- [self addConstraint:[NSLayoutConstraint constraintWithItem:_logoView
- attribute:NSLayoutAttributeBaseline
- relatedBy:NSLayoutRelationEqual
- toItem:_attributionView
- attribute:NSLayoutAttributeBaseline
- multiplier:1
- constant:_logoView.image.alignmentRect.origin.y]];
- [self addConstraint:[NSLayoutConstraint constraintWithItem:_attributionView
- attribute:NSLayoutAttributeLeading
- relatedBy:NSLayoutRelationEqual
- toItem:_logoView
- attribute:NSLayoutAttributeTrailing
- multiplier:1
- constant:8]];
-
- [super updateConstraints];
}
- (void)renderSync {
@@ -944,7 +943,6 @@ public:
if ([source isKindOfClass:[MGLTileSource class]]) {
[self installAttributionView];
}
- self.needsUpdateConstraints = YES;
self.needsDisplay = YES;
}