diff options
author | Brad Leege <bleege@gmail.com> | 2015-02-12 18:45:30 -0800 |
---|---|---|
committer | Brad Leege <bleege@gmail.com> | 2015-02-12 18:45:30 -0800 |
commit | d5109659b145e0c962e4031ecf488c3e4b8dff2c (patch) | |
tree | f2ef4e065c7e6fd5424fb1368486cc143f49926c | |
parent | 6831f8a4cd6c4502468e077a608fd58005275511 (diff) | |
download | qtlocation-mapboxgl-d5109659b145e0c962e4031ecf488c3e4b8dff2c.tar.gz |
#868 - Updating getLatLon() calls in MapView and NativeMapView. Updating Java to C++ bindings to support refactored names.
3 files changed, 21 insertions, 21 deletions
diff --git a/android/cpp/jni.cpp b/android/cpp/jni.cpp index 122ec794d6..56de8ff1b4 100644 --- a/android/cpp/jni.cpp +++ b/android/cpp/jni.cpp @@ -722,7 +722,7 @@ extern "C" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) { return JNI_ERR; } - lonLatClass = env->FindClass("com/mapbox/mapboxgl/lib/LonLat"); + lonLatClass = env->FindClass("com/mapbox/mapboxgl/lib/geometry/LatLng"); if (lonLatClass == nullptr) { env->ExceptionDescribe(); return JNI_ERR; @@ -734,19 +734,19 @@ extern "C" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) { return JNI_ERR; } - lonLatLonId = env->GetFieldID(lonLatClass, "lon", "D"); + lonLatLonId = env->GetFieldID(lonLatClass, "longitude", "D"); if (lonLatLonId == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - lonLatLatId = env->GetFieldID(lonLatClass, "lat", "D"); + lonLatLatId = env->GetFieldID(lonLatClass, "latitude", "D"); if (lonLatLatId == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - lonLatZoomClass = env->FindClass("com/mapbox/mapboxgl/lib/LonLatZoom"); + lonLatZoomClass = env->FindClass("com/mapbox/mapboxgl/lib/LatLngZoom"); if (lonLatClass == nullptr) { env->ExceptionDescribe(); return JNI_ERR; @@ -758,13 +758,13 @@ extern "C" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) { return JNI_ERR; } - lonLatZoomLonId = env->GetFieldID(lonLatZoomClass, "lon", "D"); + lonLatZoomLonId = env->GetFieldID(lonLatZoomClass, "longitude", "D"); if (lonLatZoomLonId == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - lonLatZoomLatId = env->GetFieldID(lonLatZoomClass, "lat", "D"); + lonLatZoomLatId = env->GetFieldID(lonLatZoomClass, "latitude", "D"); if (lonLatZoomLatId == nullptr) { env->ExceptionDescribe(); return JNI_ERR; @@ -892,9 +892,9 @@ extern "C" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) { reinterpret_cast<void *>(&nativeGetAccessToken)}, {"nativeCancelTransitions", "(J)V", reinterpret_cast<void *>(&nativeCancelTransitions)}, {"nativeMoveBy", "(JDDJ)V", reinterpret_cast<void *>(&nativeMoveBy)}, - {"nativeSetLonLat", "(JLcom/mapbox/mapboxgl/lib/LonLat;J)V", + {"nativeSetLonLat", "(JLcom/mapbox/mapboxgl/lib/geometry/LatLng;J)V", reinterpret_cast<void *>(&nativeSetLonLat)}, - {"nativeGetLonLat", "(J)Lcom/mapbox/mapboxgl/lib/LonLat;", + {"nativeGetLonLat", "(J)Lcom/mapbox/mapboxgl/lib/geometry/LatLng;", reinterpret_cast<void *>(&nativeGetLonLat)}, {"nativeStartPanning", "(J)V", reinterpret_cast<void *>(&nativeStartPanning)}, {"nativeStopPanning", "(J)V", reinterpret_cast<void *>(&nativeStopPanning)}, @@ -904,9 +904,9 @@ extern "C" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) { {"nativeGetScale", "(J)D", reinterpret_cast<void *>(&nativeGetScale)}, {"nativeSetZoom", "(JDJ)V", reinterpret_cast<void *>(&nativeSetZoom)}, {"nativeGetZoom", "(J)D", reinterpret_cast<void *>(&nativeGetZoom)}, - {"nativeSetLonLatZoom", "(JLcom/mapbox/mapboxgl/lib/LonLatZoom;J)V", + {"nativeSetLonLatZoom", "(JLcom/mapbox/mapboxgl/lib/LatLngZoom;J)V", reinterpret_cast<void *>(&nativeSetLonLatZoom)}, - {"nativeGetLonLatZoom", "(J)Lcom/mapbox/mapboxgl/lib/LonLatZoom;", + {"nativeGetLonLatZoom", "(J)Lcom/mapbox/mapboxgl/lib/LatLngZoom;", reinterpret_cast<void *>(&nativeGetLonLatZoom)}, {"nativeResetZoom", "(J)V", reinterpret_cast<void *>(&nativeResetZoom)}, {"nativeStartPanning", "(J)V", reinterpret_cast<void *>(&nativeStartScaling)}, diff --git a/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/lib/MapView.java b/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/lib/MapView.java index 961309fb35..217c58c963 100644 --- a/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/lib/MapView.java +++ b/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/lib/MapView.java @@ -208,7 +208,7 @@ public class MapView extends SurfaceView { // public LatLng getCenterCoordinate() { - return mNativeMapView.getLonLat(); + return mNativeMapView.getLatLng(); } public void setCenterCoordinate(LatLng centerCoordinate) { @@ -217,7 +217,7 @@ public class MapView extends SurfaceView { public void setCenterCoordinate(LatLng centerCoordinate, boolean animated) { long duration = animated ? ANIMATION_DURATION : 0; - mNativeMapView.setLonLat(centerCoordinate, duration); + mNativeMapView.setLatLng(centerCoordinate, duration); } public void setCenterCoordinate(LatLngZoom centerCoordinate) { @@ -227,7 +227,7 @@ public class MapView extends SurfaceView { public void setCenterCoordinate(LatLngZoom centerCoordinate, boolean animated) { long duration = animated ? ANIMATION_DURATION : 0; - mNativeMapView.setLonLatZoom(centerCoordinate, duration); + mNativeMapView.setLatLngZoom(centerCoordinate, duration); } public double getDirection() { diff --git a/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/lib/NativeMapView.java b/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/lib/NativeMapView.java index eeaa5203f4..17a95fa324 100644 --- a/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/lib/NativeMapView.java +++ b/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/lib/NativeMapView.java @@ -243,15 +243,15 @@ class NativeMapView { nativeMoveBy(mNativeMapViewPtr, dx, dy, duration); } - public void setLonLat(LatLng latLng) { - setLonLat(latLng, 0); + public void setLatLng(LatLng latLng) { + setLatLng(latLng, 0); } - public void setLonLat(LatLng latLng, long duration) { + public void setLatLng(LatLng latLng, long duration) { nativeSetLonLat(mNativeMapViewPtr, latLng, duration); } - public LatLng getLonLat() { + public LatLng getLatLng() { return nativeGetLonLat(mNativeMapViewPtr); } @@ -307,15 +307,15 @@ class NativeMapView { return nativeGetZoom(mNativeMapViewPtr); } - public void setLonLatZoom(LatLngZoom lonLatZoom) { - setLonLatZoom(lonLatZoom, 0); + public void setLatLngZoom(LatLngZoom lonLatZoom) { + setLatLngZoom(lonLatZoom, 0); } - public void setLonLatZoom(LatLngZoom lonLatZoom, long duration) { + public void setLatLngZoom(LatLngZoom lonLatZoom, long duration) { nativeSetLonLatZoom(mNativeMapViewPtr, lonLatZoom, duration); } - public LatLngZoom getLonLatZoom() { + public LatLngZoom getLatLngZoom() { return nativeGetLonLatZoom(mNativeMapViewPtr); } |