diff options
author | Brad Leege <bleege@gmail.com> | 2015-12-02 18:19:23 -0600 |
---|---|---|
committer | Brad Leege <bleege@gmail.com> | 2015-12-03 16:57:43 -0600 |
commit | 349f47ba92d26089ec70e94603e3e27f0a69a6ac (patch) | |
tree | 9026093655f07fbe6f99267c7805b655a52b0d84 /platform | |
parent | 6ffcb7b6f68c6b896b84eabb229072f113f468fe (diff) | |
download | qtlocation-mapboxgl-349f47ba92d26089ec70e94603e3e27f0a69a6ac.tar.gz |
[android] #2805 - Basic wiring up of Android Tilt methods to Core GL Pitch methods
Diffstat (limited to 'platform')
-rw-r--r-- | platform/android/jni.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/platform/android/jni.cpp b/platform/android/jni.cpp index 530505149c..e6cbe81193 100644 --- a/platform/android/jni.cpp +++ b/platform/android/jni.cpp @@ -664,6 +664,20 @@ void JNICALL nativeResetPosition(JNIEnv *env, jobject obj, jlong nativeMapViewPt nativeMapView->getMap().resetPosition(); } +jdouble JNICALL nativeGetPitch(JNIEnv *env, jobject obj, jlong nativeMapViewPtr) { + mbgl::Log::Debug(mbgl::Event::JNI, "nativeGetPitch"); + assert(nativeMapViewPtr != 0); + NativeMapView *nativeMapView = reinterpret_cast<NativeMapView *>(nativeMapViewPtr); + return nativeMapView->getMap().getPitch(); +} + +void JNICALL nativeSetPitch(JNIEnv *env, jobject obj, jlong nativeMapViewPtr, jdouble pitch) { + mbgl::Log::Debug(mbgl::Event::JNI, "nativeGetPitch"); + assert(nativeMapViewPtr != 0); + NativeMapView *nativeMapView = reinterpret_cast<NativeMapView *>(nativeMapViewPtr); + nativeMapView->getMap().setPitch(pitch, std::chrono::milliseconds(0)); +} + void JNICALL nativeScaleBy(JNIEnv *env, jobject obj, jlong nativeMapViewPtr, jdouble ds, jdouble cx, jdouble cy, jlong duration) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeScaleBy"); @@ -1888,6 +1902,8 @@ extern "C" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) { {"nativeGetLatLng", "(J)Lcom/mapbox/mapboxsdk/geometry/LatLng;", reinterpret_cast<void *>(&nativeGetLatLng)}, {"nativeResetPosition", "(J)V", reinterpret_cast<void *>(&nativeResetPosition)}, + {"nativeGetPitch", "(J)D", reinterpret_cast<void *>(&nativeGetPitch)}, + {"nativeSetPitch", "(JD)V", reinterpret_cast<void *>(&nativeSetPitch)}, {"nativeScaleBy", "(JDDDJ)V", reinterpret_cast<void *>(&nativeScaleBy)}, {"nativeSetScale", "(JDDDJ)V", reinterpret_cast<void *>(&nativeSetScale)}, {"nativeGetScale", "(J)D", reinterpret_cast<void *>(&nativeGetScale)}, |