From 4caf8b5b5022771d0edf59b1e2fc4d8060081640 Mon Sep 17 00:00:00 2001 From: Leith Bade Date: Thu, 6 Nov 2014 20:52:50 +1100 Subject: [PATCH] Remove source functions --- android/cpp/JNI.cpp | 33 ------------------- .../java/com/mapbox/mapboxgl/lib/MapView.java | 3 -- .../mapbox/mapboxgl/lib/NativeMapView.java | 25 -------------- 3 files changed, 61 deletions(-) diff --git a/android/cpp/JNI.cpp b/android/cpp/JNI.cpp index 2dbfedcbe..c12828ae0 100644 --- a/android/cpp/JNI.cpp +++ b/android/cpp/JNI.cpp @@ -242,35 +242,6 @@ void JNICALL nativeCleanup(JNIEnv* env, jobject obj, jlong native_map_view_ptr) native_map_view->getMap()->cleanup(); } -// TODO remove these? -void JNICALL nativeAddDefaultSource(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { - VERBOSE("nativeAddDefaultSource"); - ASSERT(native_map_view_ptr != 0); -// NativeMapView* native_map_view = reinterpret_cast(native_map_view_ptr); -// native_map_view->getMap()->addDefaultSource(); -} - -void JNICALL nativeRemoveDefaultSource(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { - VERBOSE("nativeRemoveDefaultSource"); - ASSERT(native_map_view_ptr != 0); -// NativeMapView* native_map_view = reinterpret_cast(native_map_view_ptr); -// native_map_view->getMap()->removeDefaultSource(); -} - -void JNICALL nativeAddSource(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jstring name, jstring url) { - VERBOSE("nativeAddSource"); - ASSERT(native_map_view_ptr != 0); -// NativeMapView* native_map_view = reinterpret_cast(native_map_view_ptr); -// native_map_view->getMap()->addSource(std_string_from_jstring(env, name), std_string_from_jstring(env, url)); -} - -void JNICALL nativeRemoveSource(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jstring name) { - VERBOSE("nativeRemoveSource"); - ASSERT(native_map_view_ptr != 0); -// NativeMapView* native_map_view = reinterpret_cast(native_map_view_ptr); -// native_map_view->getMap()->removeSource(std_string_from_jstring(env, name)); -} - void JNICALL nativeResize(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jint width, jint height, jfloat ratio) { VERBOSE("nativeResize"); ASSERT(native_map_view_ptr != 0); @@ -734,10 +705,6 @@ extern "C" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) { { "nativeRerender", "(J)V", reinterpret_cast(&nativeRerender) }, { "nativeUpdate", "(J)V", reinterpret_cast(&nativeUpdate) }, { "nativeCleanup", "(J)V", reinterpret_cast(&nativeCleanup) }, - { "nativeAddDefaultSource", "(J)V", reinterpret_cast(&nativeAddDefaultSource) }, - { "nativeRemoveDefaultSource", "(J)V", reinterpret_cast(&nativeRemoveDefaultSource) }, - { "nativeAddSource", "(JLjava/lang/String;Ljava/lang/String;)V", reinterpret_cast(&nativeAddSource) }, - { "nativeRemoveSource", "(JLjava/lang/String;)V", reinterpret_cast(&nativeRemoveSource) }, { "nativeResize", "(JIIF)V", reinterpret_cast(static_cast(&nativeResize)) }, { "nativeResize", "(JIIFII)V", reinterpret_cast(static_cast(&nativeResize)) }, { "nativeSetAppliedClasses", "(JLjava/util/Set;)V", reinterpret_cast(&nativeSetAppliedClasses) }, diff --git a/android/java/lib/src/main/java/com/mapbox/mapboxgl/lib/MapView.java b/android/java/lib/src/main/java/com/mapbox/mapboxgl/lib/MapView.java index 0f1961d24..87ab2e885 100644 --- a/android/java/lib/src/main/java/com/mapbox/mapboxgl/lib/MapView.java +++ b/android/java/lib/src/main/java/com/mapbox/mapboxgl/lib/MapView.java @@ -127,9 +127,6 @@ public class MapView extends SurfaceView { // Create the NativeMapView mNativeMapView = new NativeMapView(this, mDefaultStyleJSON); - mNativeMapView.addDefaultSource(); - // mNativeMapView.addSource("countries", - // "http://192.168.20.103/%d/%d/%d.pbf"); // Load the attributes TypedArray typedArray = context.obtainStyledAttributes(attrs, diff --git a/android/java/lib/src/main/java/com/mapbox/mapboxgl/lib/NativeMapView.java b/android/java/lib/src/main/java/com/mapbox/mapboxgl/lib/NativeMapView.java index 468d4713d..1d1fa5f4d 100644 --- a/android/java/lib/src/main/java/com/mapbox/mapboxgl/lib/NativeMapView.java +++ b/android/java/lib/src/main/java/com/mapbox/mapboxgl/lib/NativeMapView.java @@ -92,22 +92,6 @@ class NativeMapView { nativeCleanup(mNativeMapViewPtr); } - public void addDefaultSource() { - nativeAddDefaultSource(mNativeMapViewPtr); - } - - public void removeDefaultSource() { - nativeRemoveDefaultSource(mNativeMapViewPtr); - } - - public void addSource(String name, String url) { - nativeAddSource(mNativeMapViewPtr, name, url); - } - - public void removeSource(String name) { - nativeRemoveSource(mNativeMapViewPtr, name); - } - public void resize(int width, int height) { resize(width, height, 1.0f); } @@ -402,15 +386,6 @@ class NativeMapView { private native void nativeCleanup(long nativeMapViewPtr); - private native void nativeAddDefaultSource(long nativeMapViewPtr); - - private native void nativeRemoveDefaultSource(long nativeMapViewPtr); - - private native void nativeAddSource(long nativeMapViewPtr, String name, - String url); - - private native void nativeRemoveSource(long nativeMapViewPtr, String name); - private native void nativeResize(long nativeMapViewPtr, int width, int height, float ratio);