summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2015-04-01 13:49:35 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2015-04-02 16:12:29 -0700
commit12c07b916b106272ba68f0fc85a10b774fd07a50 (patch)
tree0dcaf8906d8e3b2df9b5c7481778ab176b7ae335 /android
parent9e38d7cc2bcf6db0dc8377693e398e6f79f9b170 (diff)
downloadqtlocation-mapboxgl-12c07b916b106272ba68f0fc85a10b774fd07a50.tar.gz
Rework easing transition code
This brings the easing transition code a bit closer to how easings work in gl-js. Instead of having an array of individual transitions for scale, rotate, and pan, there is a single transition function that does all the required calculations. This permits us to: * Eliminate the "timeout" transition. (Fixes #126) * Replace start/stopPanning() et al with setGestureInProgress(). Apps or SDKs are expected to make paired calls to setGestureInProgress(). This state will be ORed with the active easing state to determine when to use texture interpolation. (Fixes #79) * Run style recalculations only when an ease transition that affects the zoom is in progress. (Fixes #1155)
Diffstat (limited to 'android')
-rw-r--r--android/cpp/jni.cpp48
-rw-r--r--android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/views/NativeMapView.java36
2 files changed, 0 insertions, 84 deletions
diff --git a/android/cpp/jni.cpp b/android/cpp/jni.cpp
index ce61a01bf9..b6e46ed5ac 100644
--- a/android/cpp/jni.cpp
+++ b/android/cpp/jni.cpp
@@ -461,20 +461,6 @@ jobject JNICALL nativeGetLatLng(JNIEnv *env, jobject obj, jlong nativeMapViewPtr
return ret;
}
-void JNICALL nativeStartPanning(JNIEnv *env, jobject obj, jlong nativeMapViewPtr) {
- mbgl::Log::Debug(mbgl::Event::JNI, "nativeStartPanning");
- assert(nativeMapViewPtr != 0);
- NativeMapView *nativeMapView = reinterpret_cast<NativeMapView *>(nativeMapViewPtr);
- nativeMapView->getMap().startPanning();
-}
-
-void JNICALL nativeStopPanning(JNIEnv *env, jobject obj, jlong nativeMapViewPtr) {
- mbgl::Log::Debug(mbgl::Event::JNI, "nativeStopPanning");
- assert(nativeMapViewPtr != 0);
- NativeMapView *nativeMapView = reinterpret_cast<NativeMapView *>(nativeMapViewPtr);
- nativeMapView->getMap().stopPanning();
-}
-
void JNICALL nativeResetPosition(JNIEnv *env, jobject obj, jlong nativeMapViewPtr) {
mbgl::Log::Debug(mbgl::Event::JNI, "nativeResetPosition");
assert(nativeMapViewPtr != 0);
@@ -570,20 +556,6 @@ void JNICALL nativeResetZoom(JNIEnv *env, jobject obj, jlong nativeMapViewPtr) {
nativeMapView->getMap().resetZoom();
}
-void JNICALL nativeStartScaling(JNIEnv *env, jobject obj, jlong nativeMapViewPtr) {
- mbgl::Log::Debug(mbgl::Event::JNI, "nativeStartScaling");
- assert(nativeMapViewPtr != 0);
- NativeMapView *nativeMapView = reinterpret_cast<NativeMapView *>(nativeMapViewPtr);
- nativeMapView->getMap().startScaling();
-}
-
-void JNICALL nativeStopScaling(JNIEnv *env, jobject obj, jlong nativeMapViewPtr) {
- mbgl::Log::Debug(mbgl::Event::JNI, "nativeStopScaling");
- assert(nativeMapViewPtr != 0);
- NativeMapView *nativeMapView = reinterpret_cast<NativeMapView *>(nativeMapViewPtr);
- return nativeMapView->getMap().stopScaling();
-}
-
jdouble JNICALL nativeGetMinZoom(JNIEnv *env, jobject obj, jlong nativeMapViewPtr) {
mbgl::Log::Debug(mbgl::Event::JNI, "nativeGetMinZoom");
assert(nativeMapViewPtr != 0);
@@ -636,20 +608,6 @@ void JNICALL nativeResetNorth(JNIEnv *env, jobject obj, jlong nativeMapViewPtr)
nativeMapView->getMap().resetNorth();
}
-void JNICALL nativeStartRotating(JNIEnv *env, jobject obj, jlong nativeMapViewPtr) {
- mbgl::Log::Debug(mbgl::Event::JNI, "nativeStartRotating");
- assert(nativeMapViewPtr != 0);
- NativeMapView *nativeMapView = reinterpret_cast<NativeMapView *>(nativeMapViewPtr);
- nativeMapView->getMap().startRotating();
-}
-
-void JNICALL nativeStopRotating(JNIEnv *env, jobject obj, jlong nativeMapViewPtr) {
- mbgl::Log::Debug(mbgl::Event::JNI, "nativeStopRotating");
- assert(nativeMapViewPtr != 0);
- NativeMapView *nativeMapView = reinterpret_cast<NativeMapView *>(nativeMapViewPtr);
- nativeMapView->getMap().stopRotating();
-}
-
void JNICALL nativeSetDebug(JNIEnv *env, jobject obj, jlong nativeMapViewPtr, jboolean debug) {
mbgl::Log::Debug(mbgl::Event::JNI, "nativeSetDebug");
assert(nativeMapViewPtr != 0);
@@ -1029,8 +987,6 @@ extern "C" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) {
reinterpret_cast<void *>(&nativeSetLatLng)},
{"nativeGetLatLng", "(J)Lcom/mapbox/mapboxgl/geometry/LatLng;",
reinterpret_cast<void *>(&nativeGetLatLng)},
- {"nativeStartPanning", "(J)V", reinterpret_cast<void *>(&nativeStartPanning)},
- {"nativeStopPanning", "(J)V", reinterpret_cast<void *>(&nativeStopPanning)},
{"nativeResetPosition", "(J)V", reinterpret_cast<void *>(&nativeResetPosition)},
{"nativeScaleBy", "(JDDDJ)V", reinterpret_cast<void *>(&nativeScaleBy)},
{"nativeSetScale", "(JDDDJ)V", reinterpret_cast<void *>(&nativeSetScale)},
@@ -1042,8 +998,6 @@ extern "C" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) {
{"nativeGetLatLngZoom", "(J)Lcom/mapbox/mapboxgl/geometry/LatLngZoom;",
reinterpret_cast<void *>(&nativeGetLatLngZoom)},
{"nativeResetZoom", "(J)V", reinterpret_cast<void *>(&nativeResetZoom)},
- {"nativeStartPanning", "(J)V", reinterpret_cast<void *>(&nativeStartScaling)},
- {"nativeStopPanning", "(J)V", reinterpret_cast<void *>(&nativeStopScaling)},
{"nativeGetMinZoom", "(J)D", reinterpret_cast<void *>(&nativeGetMinZoom)},
{"nativeGetMaxZoom", "(J)D", reinterpret_cast<void *>(&nativeGetMaxZoom)},
{"nativeRotateBy", "(JDDDDJ)V", reinterpret_cast<void *>(&nativeRotateBy)},
@@ -1057,8 +1011,6 @@ extern "C" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) {
&nativeSetBearing))},
{"nativeGetBearing", "(J)D", reinterpret_cast<void *>(&nativeGetBearing)},
{"nativeResetNorth", "(J)V", reinterpret_cast<void *>(&nativeResetNorth)},
- {"nativeStartRotating", "(J)V", reinterpret_cast<void *>(&nativeStartRotating)},
- {"nativeStopRotating", "(J)V", reinterpret_cast<void *>(&nativeStopRotating)},
{"nativeSetDebug", "(JZ)V", reinterpret_cast<void *>(&nativeSetDebug)},
{"nativeToggleDebug", "(J)V", reinterpret_cast<void *>(&nativeToggleDebug)},
{"nativeGetDebug", "(J)Z", reinterpret_cast<void *>(&nativeGetDebug)},
diff --git a/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/views/NativeMapView.java b/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/views/NativeMapView.java
index 186b391a84..d7ca950fbf 100644
--- a/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/views/NativeMapView.java
+++ b/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/views/NativeMapView.java
@@ -213,14 +213,6 @@ class NativeMapView {
return nativeGetLatLng(mNativeMapViewPtr);
}
- public void startPanning() {
- nativeStartPanning(mNativeMapViewPtr);
- }
-
- public void stopPanning() {
- nativeStopPanning(mNativeMapViewPtr);
- }
-
public void resetPosition() {
nativeResetPosition(mNativeMapViewPtr);
}
@@ -281,14 +273,6 @@ class NativeMapView {
nativeResetZoom(mNativeMapViewPtr);
}
- public void startScaling() {
- nativeStartScaling(mNativeMapViewPtr);
- }
-
- public void stopScaling() {
- nativeStopScaling(mNativeMapViewPtr);
- }
-
public double getMinZoom() {
return nativeGetMinZoom(mNativeMapViewPtr);
}
@@ -326,14 +310,6 @@ class NativeMapView {
nativeResetNorth(mNativeMapViewPtr);
}
- public void startRotating() {
- nativeStartRotating(mNativeMapViewPtr);
- }
-
- public void stopRotating() {
- nativeStopRotating(mNativeMapViewPtr);
- }
-
public void setDebug(boolean debug) {
nativeSetDebug(mNativeMapViewPtr, debug);
}
@@ -468,10 +444,6 @@ class NativeMapView {
private native LatLng nativeGetLatLng(long nativeMapViewPtr);
- private native void nativeStartPanning(long nativeMapViewPtr);
-
- private native void nativeStopPanning(long nativeMapViewPtr);
-
private native void nativeResetPosition(long nativeMapViewPtr);
private native void nativeScaleBy(long nativeMapViewPtr, double ds,
@@ -494,10 +466,6 @@ class NativeMapView {
private native void nativeResetZoom(long nativeMapViewPtr);
- private native void nativeStartScaling(long nativeMapViewPtr);
-
- private native void nativeStopScaling(long nativeMapViewPtr);
-
private native double nativeGetMinZoom(long nativeMapViewPtr);
private native double nativeGetMaxZoom(long nativeMapViewPtr);
@@ -515,10 +483,6 @@ class NativeMapView {
private native void nativeResetNorth(long nativeMapViewPtr);
- private native void nativeStartRotating(long nativeMapViewPtr);
-
- private native void nativeStopRotating(long nativeMapViewPtr);
-
private native void nativeSetDebug(long nativeMapViewPtr, boolean debug);
private native void nativeToggleDebug(long nativeMapViewPtr);