summaryrefslogtreecommitdiff
path: root/platform/ios/src
diff options
context:
space:
mode:
authorLloyd Sheng <i@lloydsheng.com>2019-09-17 17:49:40 +0800
committerLloyd Sheng <i@lloydsheng.com>2019-09-20 10:18:24 +0800
commit7024716992ef29377a393b427635bc1116bcaaee (patch)
tree62230d02eea95b14e9b510e7aa32198495d355a2 /platform/ios/src
parentb1a0cc3008cc7c6ce684724f1dcefd7479419b8b (diff)
downloadqtlocation-mapboxgl-7024716992ef29377a393b427635bc1116bcaaee.tar.gz
Fix issues and add changelog
Diffstat (limited to 'platform/ios/src')
-rw-r--r--platform/ios/src/MGLMapView.mm24
-rw-r--r--platform/ios/src/UIView+MGLAdditions.h2
-rw-r--r--platform/ios/src/UIView+MGLAdditions.m2
3 files changed, 10 insertions, 18 deletions
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index a445b0890f..4d654c79d8 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -963,22 +963,14 @@ public:
[self updateAttributionAlertView];
- if (!CGRectContainsRect(self.bounds, self.attributionButton.mgl_frameForTransformIdentity)) {
- [NSException raise:NSInvalidArgumentException
- format:@"The attribution is not in the visible area of the mapview. Please check your position and offset settings"];
- }
- if (!CGRectContainsRect(self.bounds, self.scaleBar.mgl_frameForTransformIdentity)) {
- [NSException raise:NSInvalidArgumentException
- format:@"The scaleBar is not in the visible area of the mapview. Please check your position and offset settings"];
- }
- if (!CGRectContainsRect(self.bounds, self.compassView.mgl_frameForTransformIdentity)) {
- [NSException raise:NSInvalidArgumentException
- format:@"The compassView is not in the visible area of the mapview. Please check your position and offset settings"];
- }
- if (!CGRectContainsRect(self.bounds, self.logoView.mgl_frameForTransformIdentity)) {
- [NSException raise:NSInvalidArgumentException
- format:@"The logoView is not in the visible area of the mapview. Please check your position and offset settings"];
- }
+ MGLAssert(CGRectContainsRect(self.bounds, self.attributionButton.mgl_frameForIdentifyTransform),
+ @"The attribution is not in the visible area of the mapview. Please check your position and offset settings");
+ MGLAssert(CGRectContainsRect(self.bounds, self.scaleBar.mgl_frameForIdentifyTransform),
+ @"The scaleBar is not in the visible area of the mapview. Please check your position and offset settings");
+ MGLAssert(CGRectContainsRect(self.bounds, self.compassView.mgl_frameForIdentifyTransform),
+ @"The compassView is not in the visible area of the mapview. Please check your position and offset settings");
+ MGLAssert(CGRectContainsRect(self.bounds, self.logoView.mgl_frameForIdentifyTransform),
+ @"The logoView is not in the visible area of the mapview. Please check your position and offset settings");
}
/// Updates `contentInset` to reflect the current window geometry.
diff --git a/platform/ios/src/UIView+MGLAdditions.h b/platform/ios/src/UIView+MGLAdditions.h
index ba9f650c38..3395ab999c 100644
--- a/platform/ios/src/UIView+MGLAdditions.h
+++ b/platform/ios/src/UIView+MGLAdditions.h
@@ -14,7 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
- (NSLayoutXAxisAnchor *)mgl_safeTrailingAnchor;
-- (CGRect)mgl_frameForTransformIdentity;
+- (CGRect)mgl_frameForIdentifyTransform;
@end
diff --git a/platform/ios/src/UIView+MGLAdditions.m b/platform/ios/src/UIView+MGLAdditions.m
index 5106cb0caa..802ceb0704 100644
--- a/platform/ios/src/UIView+MGLAdditions.m
+++ b/platform/ios/src/UIView+MGLAdditions.m
@@ -66,7 +66,7 @@
}
}
-- (CGRect)mgl_frameForTransformIdentity {
+- (CGRect)mgl_frameForIdentifyTransform {
CGPoint center = self.center;
CGSize size = self.bounds.size;