[core, ios, osx] Tilt around visual center point

The tilt gesture on both iOS and OS X now respects the content insets. On iOS, in user tracking mode, it additionally respects the user dot’s position if it’s aligned to the top or bottom of the view.
This commit is contained in:
Minh Nguyễn
2016-01-26 16:59:54 -08:00
committed by Minh Nguyễn
parent 97fc2120c4
commit 8a23bdcd01
7 changed files with 30 additions and 6 deletions

View File

@@ -680,11 +680,12 @@ jdouble JNICALL nativeGetPitch(JNIEnv *env, jobject obj, jlong nativeMapViewPtr)
return nativeMapView->getMap().getPitch();
}
void JNICALL nativeSetPitch(JNIEnv *env, jobject obj, jlong nativeMapViewPtr, jdouble pitch, jlong duration) {
void JNICALL nativeSetPitch(JNIEnv *env, jobject obj, jlong nativeMapViewPtr, jdouble pitch, jlong milliseconds) {
mbgl::Log::Debug(mbgl::Event::JNI, "nativeGetPitch");
assert(nativeMapViewPtr != 0);
NativeMapView *nativeMapView = reinterpret_cast<NativeMapView *>(nativeMapViewPtr);
nativeMapView->getMap().setPitch(pitch, mbgl::Milliseconds(duration));
mbgl::Duration duration((mbgl::Milliseconds(milliseconds)));
nativeMapView->getMap().setPitch(pitch, duration);
}
void JNICALL nativeScaleBy(JNIEnv *env, jobject obj, jlong nativeMapViewPtr, jdouble ds, jdouble cx,