diff options
author | Brad Leege <bleege@gmail.com> | 2016-06-09 14:35:10 -0500 |
---|---|---|
committer | Brad Leege <bleege@gmail.com> | 2016-06-09 14:35:10 -0500 |
commit | b90571107d6fa5dd970d77c0b67029de8cd3461a (patch) | |
tree | db6e2015be88f435b6e890fc9a5cf6a305e2a815 /platform | |
parent | d67b88dba94a5e50eabaa8c133bb66fc3da8ee6f (diff) | |
download | qtlocation-mapboxgl-b90571107d6fa5dd970d77c0b67029de8cd3461a.tar.gz |
[android] #5291 - Fixing merge conflicts
Diffstat (limited to 'platform')
-rwxr-xr-x | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java | 4 | ||||
-rwxr-xr-x | platform/android/src/jni.cpp | 19 |
2 files changed, 2 insertions, 21 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java index e92e310c63..a93263a917 100755 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java @@ -371,9 +371,7 @@ final class NativeMapView { } public void updateMarker(Marker marker) { - LatLng position = marker.getPosition(); - Icon icon = marker.getIcon(); - nativeUpdateMarker(mNativeMapViewPtr, marker.getId(), position.getLatitude(), position.getLongitude(), icon.getId()); + nativeUpdateMarker(mNativeMapViewPtr, marker); } public void removeAnnotation(long id) { diff --git a/platform/android/src/jni.cpp b/platform/android/src/jni.cpp index 6f1b892c7e..ce6cd62179 100755 --- a/platform/android/src/jni.cpp +++ b/platform/android/src/jni.cpp @@ -660,25 +660,8 @@ void nativeResetNorth(JNIEnv *env, jni::jobject* obj, jlong nativeMapViewPtr) { nativeMapView->getMap().resetNorth(); } -jlong nativeAddMarker(JNIEnv *env, jni::jobject* obj, jlong nativeMapViewPtr, jni::jobject* marker) { - mbgl::Log::Debug(mbgl::Event::JNI, "nativeAddMarker"); - assert(nativeMapViewPtr != 0); - NativeMapView *nativeMapView = reinterpret_cast<NativeMapView *>(nativeMapViewPtr); - - jni::jobject* position = jni::GetField<jni::jobject*>(*env, marker, *markerPositionId); - jni::jobject* icon = jni::GetField<jni::jobject*>(*env, marker, *markerIconId); - - jni::jstring* jid = reinterpret_cast<jni::jstring*>(jni::GetField<jni::jobject*>(*env, icon, *iconIdId)); - std::string id = std_string_from_jstring(env, jid); - - jdouble latitude = jni::GetField<jdouble>(*env, position, *latLngLatitudeId); - jdouble longitude = jni::GetField<jdouble>(*env, position, *latLngLongitudeId); - - // Because Java only has int, not unsigned int, we need to bump the annotation id up to a long. - return nativeMapView->getMap().addPointAnnotation(mbgl::PointAnnotation(mbgl::LatLng(latitude, longitude), id)); -} +void nativeUpdateMarker(JNIEnv *env, jni::jobject* obj, jlong nativeMapViewPtr, jni::jobject* marker) { -void nativeUpdateMarker(JNIEnv *env, jni::jobject* obj, jlong nativeMapViewPtr, jlong markerId, jdouble lat, jdouble lon, jni::jstring* jid) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeUpdateMarker"); assert(nativeMapViewPtr != 0); NativeMapView *nativeMapView = reinterpret_cast<NativeMapView *>(nativeMapViewPtr); |