[android] #2805 - Basic wiring up of Android Tilt methods to Core GL Pitch methods

This commit is contained in:
Brad Leege
2015-12-02 18:19:23 -06:00
parent 6ffcb7b6f6
commit 349f47ba92
3 changed files with 48 additions and 2 deletions

View File

@@ -1102,6 +1102,25 @@ public final class MapView extends FrameLayout {
this.mScrollEnabled = scrollEnabled;
}
//
// Pitch / Tilt
//
/**
* Gets the current Tilt in degrees of the MapView
* @return tilt in degrees
*/
public double getTilt() {
return mNativeMapView.getPitch();
}
/**
* Sets the Tilt in degrees of the MapView
* @param pitch New tilt in degrees
*/
public void setTilt(double pitch) {
mNativeMapView.setPitch(pitch);
}
//
// Mirrored Google Map's Camera API
@@ -1120,8 +1139,7 @@ public final class MapView extends FrameLayout {
setBearing(update.getBearing());
// TODO - Set tilt
setTilt(update.getTilt());
}
//

View File

@@ -256,6 +256,14 @@ final class NativeMapView {
nativeResetPosition(mNativeMapViewPtr);
}
public double getPitch() {
return nativeGetPitch(mNativeMapViewPtr);
}
public void setPitch(double pitch) {
nativeSetPitch(mNativeMapViewPtr, pitch);
}
public void scaleBy(double ds) {
scaleBy(ds, -1.0, -1.0);
}
@@ -533,6 +541,10 @@ final class NativeMapView {
private native void nativeResetPosition(long nativeMapViewPtr);
private native double nativeGetPitch(long nativeMapViewPtr);
private native void nativeSetPitch(long nativeMapViewPtr, double pitch);
private native void nativeScaleBy(long nativeMapViewPtr, double ds,
double cx, double cy, long duration);