[android] url getter on sources

This commit is contained in:
Ivo van Dongen
2017-05-11 15:01:33 +03:00
committed by Ivo van Dongen
parent 625c2ea527
commit 489f76d3a2
10 changed files with 92 additions and 2 deletions

View File

@@ -97,6 +97,11 @@ namespace android {
source.as<mbgl::style::GeoJSONSource>()->GeoJSONSource::setURL(jni::Make<std::string>(env, url));
}
jni::String GeoJSONSource::getURL(jni::JNIEnv& env) {
optional<std::string> url = source.as<mbgl::style::GeoJSONSource>()->GeoJSONSource::getURL();
return url ? jni::Make<jni::String>(env, *url) : jni::String();
}
jni::Array<jni::Object<geojson::Feature>> GeoJSONSource::querySourceFeatures(jni::JNIEnv& env,
jni::Array<jni::Object<>> jfilter) {
using namespace mbgl::android::conversion;
@@ -133,6 +138,7 @@ namespace android {
METHOD(&GeoJSONSource::setFeature, "nativeSetFeature"),
METHOD(&GeoJSONSource::setGeometry, "nativeSetGeometry"),
METHOD(&GeoJSONSource::setURL, "nativeSetUrl"),
METHOD(&GeoJSONSource::getURL, "nativeGetUrl"),
METHOD(&GeoJSONSource::querySourceFeatures, "querySourceFeatures")
);
}