Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
#868 - Updating getLatLon() calls in MapView and NativeMapView. Updat…
Browse files Browse the repository at this point in the history
…ing Java to C++ bindings to support refactored names.
  • Loading branch information
bleege committed Feb 13, 2015
1 parent 6831f8a commit d510965
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
20 changes: 10 additions & 10 deletions android/cpp/jni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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)},
Expand All @@ -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)},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ private void initialize(Context context, AttributeSet attrs) {
//

public LatLng getCenterCoordinate() {
return mNativeMapView.getLonLat();
return mNativeMapView.getLatLng();
}

public void setCenterCoordinate(LatLng centerCoordinate) {
Expand All @@ -217,7 +217,7 @@ public void setCenterCoordinate(LatLng centerCoordinate) {

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) {
Expand All @@ -227,7 +227,7 @@ public void setCenterCoordinate(LatLngZoom centerCoordinate) {
public void setCenterCoordinate(LatLngZoom centerCoordinate,
boolean animated) {
long duration = animated ? ANIMATION_DURATION : 0;
mNativeMapView.setLonLatZoom(centerCoordinate, duration);
mNativeMapView.setLatLngZoom(centerCoordinate, duration);
}

public double getDirection() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,15 @@ public void moveBy(double dx, double dy, long duration) {
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);
}

Expand Down Expand Up @@ -307,15 +307,15 @@ public double getZoom() {
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);
}

Expand Down

0 comments on commit d510965

Please sign in to comment.