[android] remove source returns reference

This commit is contained in:
Ivo van Dongen
2017-02-24 16:35:27 +02:00
committed by Ivo van Dongen
parent fedb21e35b
commit 3040d40772
5 changed files with 26 additions and 14 deletions

View File

@@ -844,8 +844,13 @@ void NativeMapView::addSource(JNIEnv& env, jni::jlong sourcePtr) {
}
}
void NativeMapView::removeSourceById(JNIEnv& env, jni::String id) {
map->removeSource(jni::Make<std::string>(env, id));
jni::Object<Source> NativeMapView::removeSourceById(JNIEnv& env, jni::String id) {
std::unique_ptr<mbgl::style::Source> coreSource = map->removeSource(jni::Make<std::string>(env, id));
if (coreSource) {
return jni::Object<Source>(createJavaSourcePeer(env, *map, *coreSource));
} else {
return jni::Object<Source>();
}
}
void NativeMapView::removeSource(JNIEnv&, jlong sourcePtr) {