summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Prukop <dave.prukop@mapbox.com>2018-09-20 15:13:03 -0700
committerDave Prukop <dave.prukop@mapbox.com>2018-09-20 15:13:03 -0700
commit2bbd6ef18daaf78a3540cd3656018c8db7c51b61 (patch)
tree5f9f607719383312604b963afc1666bfc9cbb9fb
parent2f7a1475e0287f9ca62c2d838f71011595cdb526 (diff)
downloadqtlocation-mapboxgl-upstream/new-set-camera.tar.gz
New setCamera: edgePadding: animated: methodupstream/new-set-camera
-rw-r--r--platform/ios/src/MGLMapView.h13
-rw-r--r--platform/ios/src/MGLMapView.mm5
-rw-r--r--platform/macos/src/MGLMapView.h13
-rw-r--r--platform/macos/src/MGLMapView.mm5
4 files changed, 36 insertions, 0 deletions
diff --git a/platform/ios/src/MGLMapView.h b/platform/ios/src/MGLMapView.h
index 02d146edcb..db638d4aad 100644
--- a/platform/ios/src/MGLMapView.h
+++ b/platform/ios/src/MGLMapView.h
@@ -865,6 +865,19 @@ MGL_EXPORT IB_DESIGNABLE
/**
Moves the viewpoint to a different location with respect to the map with an
+ optional transition animation.
+
+ @param camera The new viewpoint.
+ @param edgePadding The minimum padding (in screen points) that would be visible.
+ @param animated Specify `YES` if you want the map view to animate the change to
+ the new viewpoint or `NO` if you want the map to display the new viewpoint
+ immediately.
+
+ */
+- (void)setCamera:(MGLMapCamera *)camera edgePadding:(UIEdgeInsets)edgePadding animated:(BOOL)animated;
+
+/**
+ Moves the viewpoint to a different location with respect to the map with an
optional transition duration and timing function.
@param camera The new viewpoint.
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index 92d3724b03..9a33c345dd 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -3293,6 +3293,11 @@ public:
[self setCamera:camera animated:NO];
}
+- (void)setCamera:(MGLMapCamera *)camera edgePadding:(UIEdgeInsets)edgePadding animated:(BOOL)animated
+{
+ [self setCamera:camera withDuration:animated ? MGLAnimationDuration : 0 animationTimingFunction:nil edgePadding:edgePadding completionHandler:nil];
+}
+
- (void)setCamera:(MGLMapCamera *)camera animated:(BOOL)animated
{
[self setCamera:camera withDuration:animated ? MGLAnimationDuration : 0 animationTimingFunction:nil];
diff --git a/platform/macos/src/MGLMapView.h b/platform/macos/src/MGLMapView.h
index ddb5747109..37e976e8c1 100644
--- a/platform/macos/src/MGLMapView.h
+++ b/platform/macos/src/MGLMapView.h
@@ -310,6 +310,19 @@ MGL_EXPORT IB_DESIGNABLE
/**
Moves the viewpoint to a different location with respect to the map with an
+ optional transition animation.
+
+ @param camera The new viewpoint.
+ @param edgePadding The minimum padding (in screen points) that would be visible.
+ @param animated Specify `YES` if you want the map view to animate the change to
+ the new viewpoint or `NO` if you want the map to display the new viewpoint
+ immediately.
+
+ */
+- (void)setCamera:(MGLMapCamera *)camera edgePadding:(NSEdgeInsets)edgePadding animated:(BOOL)animated;
+
+/**
+ Moves the viewpoint to a different location with respect to the map with an
optional transition duration and timing function.
@param camera The new viewpoint.
diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm
index 92ba89f72d..215e1a6345 100644
--- a/platform/macos/src/MGLMapView.mm
+++ b/platform/macos/src/MGLMapView.mm
@@ -1120,6 +1120,11 @@ public:
[self setCamera:camera animated:NO];
}
+- (void)setCamera:(MGLMapCamera *)camera edgePadding:(NSEdgeInsets)edgePadding animated:(BOOL)animated
+{
+ [self setCamera:camera withDuration:animated ? MGLAnimationDuration : 0 animationTimingFunction:nil edgePadding:edgePadding completionHandler:nil];
+}
+
- (void)setCamera:(MGLMapCamera *)camera animated:(BOOL)animated {
[self setCamera:camera withDuration:animated ? MGLAnimationDuration : 0 animationTimingFunction:nil completionHandler:NULL];
}