summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorAleksandar Stojiljkovic <aleksandar.stojiljkovic@mapbox.com>2019-05-23 16:46:35 +0300
committerAleksandar Stojiljkovic <aleksandar.stojiljkovic@mapbox.com>2019-05-28 14:38:01 +0300
commite5431d01817c0546aa0b971a7b0b33c9bbd87077 (patch)
tree7c670c67492dcf4bd95afb5546c7f3de714ea10f /platform
parent9809c9f8f5583739e07d1a02df4c6cb96dfc4a10 (diff)
downloadqtlocation-mapboxgl-e5431d01817c0546aa0b971a7b0b33c9bbd87077.tar.gz
Asymmetric viewport changelog entry
Check edge insets difference, in addition to isEqualToMapCamera in all the places in MGLMapView before map.easeTo/map.flyTo.
Diffstat (limited to 'platform')
-rw-r--r--platform/android/CHANGELOG.md5
-rw-r--r--platform/ios/CHANGELOG.md6
-rw-r--r--platform/ios/app/MBXViewController.m4
-rw-r--r--platform/ios/src/MGLMapView.mm18
-rw-r--r--platform/macos/CHANGELOG.md6
5 files changed, 28 insertions, 11 deletions
diff --git a/platform/android/CHANGELOG.md b/platform/android/CHANGELOG.md
index 273500eca6..71b8f9e74f 100644
--- a/platform/android/CHANGELOG.md
+++ b/platform/android/CHANGELOG.md
@@ -3,6 +3,11 @@
Mapbox welcomes participation and contributions from everyone. If you'd like to do so please see the [`Contributing Guide`](https://github.com/mapbox/mapbox-gl-native/blob/master/CONTRIBUTING.md) first to get started.
## master
+
+### Styles and rendering
+
+ - Implemented asymmetric center of perspective: fixed an issue that caused the focal point to be always based on the view's horizontal center when setting [MapboxMap setPadding](https://docs.mapbox.com/android/api/map-sdk/8.0.0/com/mapbox/mapboxsdk/maps/MapboxMap.html#setPadding-int-int-int-int-). [#14664](https://github.com/mapbox/mapbox-gl-native/pull/14664)
+
## 8.0.0 - May 22, 2019
- This release improves the method for counting monthly active users. By upgrading to this release, you are opting into the changes outlined [in this blog post](https://www.mapbox.com/52219). [#14404](https://github.com/mapbox/mapbox-gl-native/pull/14404)
diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md
index d1817b734f..1f04dede2a 100644
--- a/platform/ios/CHANGELOG.md
+++ b/platform/ios/CHANGELOG.md
@@ -2,6 +2,12 @@
Mapbox welcomes participation and contributions from everyone. Please read [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started.
+## master
+
+### Styles and rendering
+
+* Implemented asymmetric center of perspective: fixed an issue that caused the focal point to be always based on the view's horizontal center when setting [MGLMapView contentInset](https://docs.mapbox.com/ios/api/maps/5.0.0/Classes/MGLMapView.html#/c:objc(cs)MGLMapView(py)contentInset). ([#14664](https://github.com/mapbox/mapbox-gl-native/pull/14664))
+
## 5.0.0 - May 22, 2019
This release improves how monthly active users are counted. By upgrading to this release, you are opting into the changes outlined in [this blog post](https://www.mapbox.com/52219) and [#14421](https://github.com/mapbox/mapbox-gl-native/pull/14421).
diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m
index 567ca151f7..893cee1cdc 100644
--- a/platform/ios/app/MBXViewController.m
+++ b/platform/ios/app/MBXViewController.m
@@ -788,14 +788,14 @@ CLLocationCoordinate2D randomWorldCoordinate() {
heading:0];
__weak typeof(self) weakSelf = self;
[self.mapView setCamera:camera withDuration:0.3 animationTimingFunction:nil completionHandler:^{
- [weakSelf.mapView setContentInset:contentInsets animated:TRUE];
+ [weakSelf.mapView setContentInset:contentInsets animated:YES];
}];
} else {
[self.view sendSubviewToBack:self.contentInsetsOverlays[0]];
[self.view sendSubviewToBack:self.contentInsetsOverlays[1]];
[self.view sendSubviewToBack:self.contentInsetsOverlays[2]];
[self.view sendSubviewToBack:self.contentInsetsOverlays[3]];
- [self.mapView setContentInset:_originalContentInsets animated:TRUE];
+ [self.mapView setContentInset:_originalContentInsets animated:YES];
}
break;
}
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index bc4900ace9..e6323d8bc1 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -1079,7 +1079,7 @@ public:
if (self.userTrackingMode == MGLUserTrackingModeNone)
{
// Don’t call -setCenterCoordinate:, which resets the user tracking mode.
- [self _setCenterCoordinate:self.centerCoordinate edgePadding:contentInset zoomLevel:self.zoomLevel direction:self.direction duration:animated ? MGLAnimationDuration : 0 animationTimingFunction:nil completionHandler:NULL];
+ [self _setCenterCoordinate:self.centerCoordinate edgePadding:contentInset zoomLevel:self.zoomLevel direction:self.direction duration:animated ? MGLAnimationDuration : 0 animationTimingFunction:nil completionHandler:nil];
_contentInset = contentInset;
}
else
@@ -1088,7 +1088,7 @@ public:
[self didUpdateLocationWithUserTrackingAnimated:animated];
}
- // Compass, logo and attribution button constraints needs to be updated.
+ // Compass, logo and attribution button constraints needs to be updated.z
[self installConstraints];
}
@@ -3290,7 +3290,7 @@ public:
zoomLevel,
direction,
MGLStringFromBOOL(animated));
- [self setCenterCoordinate:centerCoordinate zoomLevel:zoomLevel direction:direction animated:animated completionHandler:NULL];
+ [self setCenterCoordinate:centerCoordinate zoomLevel:zoomLevel direction:direction animated:animated completionHandler:nil];
}
- (void)setCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate zoomLevel:(double)zoomLevel direction:(CLLocationDirection)direction animated:(BOOL)animated completionHandler:(nullable void (^)(void))completion
@@ -3554,7 +3554,7 @@ public:
}
MGLMapCamera *camera = [self cameraForCameraOptions:cameraOptions];
- if ([self.camera isEqualToMapCamera:camera])
+ if ([self.camera isEqualToMapCamera:camera] && UIEdgeInsetsEqualToEdgeInsets(_contentInset, insets))
{
if (completion)
{
@@ -3671,7 +3671,7 @@ public:
- (void)setCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration animationTimingFunction:(nullable CAMediaTimingFunction *)function
{
MGLLogDebug(@"Setting camera: %@ duration: %f animationTimingFunction: %@", camera, duration, function);
- [self setCamera:camera withDuration:duration animationTimingFunction:function completionHandler:NULL];
+ [self setCamera:camera withDuration:duration animationTimingFunction:function completionHandler:nil];
}
- (void)setCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration animationTimingFunction:(nullable CAMediaTimingFunction *)function completionHandler:(nullable void (^)(void))completion
@@ -3707,7 +3707,7 @@ public:
};
}
- if ([self.camera isEqualToMapCamera:camera])
+ if ([self.camera isEqualToMapCamera:camera] && UIEdgeInsetsEqualToEdgeInsets(_contentInset, edgePadding))
{
if (completion)
{
@@ -3778,7 +3778,7 @@ public:
};
}
- if ([self.camera isEqualToMapCamera:camera])
+ if ([self.camera isEqualToMapCamera:camera] && UIEdgeInsetsEqualToEdgeInsets(_contentInset, insets))
{
if (completion)
{
@@ -3884,7 +3884,7 @@ public:
return self.residualCamera;
}
- mbgl::CameraOptions mapCamera = self.mbglMap.getCameraOptions(cameraOptions.padding.value_or(mbgl::EdgeInsets()));
+ mbgl::CameraOptions mapCamera = self.mbglMap.getCameraOptions();
CLLocationCoordinate2D centerCoordinate = MGLLocationCoordinate2DFromLatLng(cameraOptions.center ? *cameraOptions.center : *mapCamera.center);
double zoomLevel = cameraOptions.zoom ? *cameraOptions.zoom : self.zoomLevel;
CLLocationDirection direction = cameraOptions.bearing ? mbgl::util::wrap(*cameraOptions.bearing, 0., 360.) : self.direction;
@@ -5678,7 +5678,7 @@ public:
direction:self.directionByFollowingWithCourse
duration:animated ? MGLUserLocationAnimationDuration : 0
animationTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]
- completionHandler:NULL];
+ completionHandler:nil];
}
/// Changes the viewport based on a significant location update, such as the
diff --git a/platform/macos/CHANGELOG.md b/platform/macos/CHANGELOG.md
index b49fe81933..7aae0f2d6b 100644
--- a/platform/macos/CHANGELOG.md
+++ b/platform/macos/CHANGELOG.md
@@ -1,5 +1,11 @@
# Changelog for Mapbox Maps SDK for macOS
+## master
+
+### Styles and rendering
+
+* Implemented asymmetric center of perspective: fixed an issue that caused the focal point to be always based on the view's horizontal center when setting [MGLMapView contentInset](https://docs.mapbox.com/ios/api/maps/5.0.0/Classes/MGLMapView.html#/c:objc(cs)MGLMapView(py)contentInset). ([#14664](https://github.com/mapbox/mapbox-gl-native/pull/14664))
+
## 0.14.0 - May 22, 2018
### Styles and rendering