diff options
author | Tobrun <tobrun.van.nuland@gmail.com> | 2017-02-28 13:22:47 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-28 13:22:47 -0500 |
commit | 34fef22d95124e3e59b6c7962bdc4a01c84dde2e (patch) | |
tree | 255fc0fcb352684251c88cfb0ec24a3822008e99 /platform | |
parent | 05ec852885608070d7a5df50c7a098441e643bce (diff) | |
download | qtlocation-mapboxgl-34fef22d95124e3e59b6c7962bdc4a01c84dde2e.tar.gz |
[core] [android] - allow zooming/scaling to use AnimationOptions (#8181)
[glfw] - allow glfw binding to use AnimationOptions instead of using direction directly
Diffstat (limited to 'platform')
-rwxr-xr-x | platform/android/src/native_map_view.cpp | 16 | ||||
-rw-r--r-- | platform/glfw/glfw_view.cpp | 4 |
2 files changed, 10 insertions, 10 deletions
diff --git a/platform/android/src/native_map_view.cpp b/platform/android/src/native_map_view.cpp index 996fa2d7f3..1930d1854d 100755 --- a/platform/android/src/native_map_view.cpp +++ b/platform/android/src/native_map_view.cpp @@ -352,7 +352,7 @@ jni::Object<LatLng> NativeMapView::getLatLng(JNIEnv& env) { } void NativeMapView::setLatLng(jni::JNIEnv&, jni::jdouble latitude, jni::jdouble longitude, jni::jlong duration) { - map->setLatLng(mbgl::LatLng(latitude, longitude), insets, mbgl::Milliseconds(duration)); + map->setLatLng(mbgl::LatLng(latitude, longitude), insets, mbgl::AnimationOptions{mbgl::Milliseconds(duration)}); } void NativeMapView::setReachability(jni::JNIEnv&, jni::jboolean reachable) { @@ -370,17 +370,17 @@ jni::jdouble NativeMapView::getPitch(jni::JNIEnv&) { } void NativeMapView::setPitch(jni::JNIEnv&, jni::jdouble pitch, jni::jlong duration) { - map->setPitch(pitch, mbgl::Milliseconds(duration)); + map->setPitch(pitch, mbgl::AnimationOptions{mbgl::Milliseconds(duration)}); } void NativeMapView::scaleBy(jni::JNIEnv&, jni::jdouble ds, jni::jdouble cx, jni::jdouble cy, jni::jlong duration) { mbgl::ScreenCoordinate center(cx, cy); - map->scaleBy(ds, center, mbgl::Milliseconds(duration)); + map->scaleBy(ds, center, mbgl::AnimationOptions{mbgl::Milliseconds(duration)}); } void NativeMapView::setScale(jni::JNIEnv&, jni::jdouble scale, jni::jdouble cx, jni::jdouble cy, jni::jlong duration) { mbgl::ScreenCoordinate center(cx, cy); - map->setScale(scale, center, mbgl::Milliseconds(duration)); + map->setScale(scale, center, mbgl::AnimationOptions{mbgl::Milliseconds(duration)}); } jni::jdouble NativeMapView::getScale(jni::JNIEnv&) { @@ -388,7 +388,7 @@ jni::jdouble NativeMapView::getScale(jni::JNIEnv&) { } void NativeMapView::setZoom(jni::JNIEnv&, jni::jdouble zoom, jni::jlong duration) { - map->setZoom(zoom, mbgl::Milliseconds(duration)); + map->setZoom(zoom, mbgl::AnimationOptions{mbgl::Milliseconds(duration)}); } jni::jdouble NativeMapView::getZoom(jni::JNIEnv&) { @@ -418,16 +418,16 @@ jni::jdouble NativeMapView::getMaxZoom(jni::JNIEnv&) { void NativeMapView::rotateBy(jni::JNIEnv&, jni::jdouble sx, jni::jdouble sy, jni::jdouble ex, jni::jdouble ey, jni::jlong duration) { mbgl::ScreenCoordinate first(sx, sy); mbgl::ScreenCoordinate second(ex, ey); - map->rotateBy(first, second, mbgl::Milliseconds(duration)); + map->rotateBy(first, second, mbgl::AnimationOptions{mbgl::Milliseconds(duration)}); } void NativeMapView::setBearing(jni::JNIEnv&, jni::jdouble degrees, jni::jlong duration) { - map->setBearing(degrees, mbgl::Milliseconds(duration)); + map->setBearing(degrees, mbgl::AnimationOptions{mbgl::Milliseconds(duration)}); } void NativeMapView::setBearingXY(jni::JNIEnv&, jni::jdouble degrees, jni::jdouble cx, jni::jdouble cy, jni::jlong duration) { mbgl::ScreenCoordinate center(cx, cy); - map->setBearing(degrees, center, mbgl::Milliseconds(duration)); + map->setBearing(degrees, center, mbgl::AnimationOptions{mbgl::Milliseconds(duration)}); } jni::jdouble NativeMapView::getBearing(jni::JNIEnv&) { diff --git a/platform/glfw/glfw_view.cpp b/platform/glfw/glfw_view.cpp index 15a229d4ae..4070a0fe9b 100644 --- a/platform/glfw/glfw_view.cpp +++ b/platform/glfw/glfw_view.cpp @@ -417,9 +417,9 @@ void GLFWView::onMouseClick(GLFWwindow *window, int button, int action, int modi double now = glfwGetTime(); if (now - view->lastClick < 0.4 /* ms */) { if (modifiers & GLFW_MOD_SHIFT) { - view->map->scaleBy(0.5, mbgl::ScreenCoordinate { view->lastX, view->lastY }, mbgl::Milliseconds(500)); + view->map->scaleBy(0.5, mbgl::ScreenCoordinate { view->lastX, view->lastY }, mbgl::AnimationOptions{{mbgl::Milliseconds(500)}}); } else { - view->map->scaleBy(2.0, mbgl::ScreenCoordinate { view->lastX, view->lastY }, mbgl::Milliseconds(500)); + view->map->scaleBy(2.0, mbgl::ScreenCoordinate { view->lastX, view->lastY }, mbgl::AnimationOptions{{mbgl::Milliseconds(500)}}); } } view->lastClick = now; |