Implemented synchronous update for GeoJSON source (#3968)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -242,6 +242,10 @@ void GeoJSONSource::setCollectionSync(jni::JNIEnv& env, const jni::Object<JNITyp
|
||||
setAsync(converterFn);
|
||||
}
|
||||
|
||||
jboolean GeoJSONSource::isUpdateSynchronous(jni::JNIEnv&) {
|
||||
return source.as<style::GeoJSONSource>()->isUpdateSynchronous();
|
||||
}
|
||||
|
||||
void GeoJSONSource::registerNative(jni::JNIEnv& env) {
|
||||
// Lookup the class
|
||||
static auto& javaClass = jni::Class<GeoJSONSource>::Singleton(env);
|
||||
@@ -269,7 +273,8 @@ void GeoJSONSource::registerNative(jni::JNIEnv& env) {
|
||||
METHOD(&GeoJSONSource::querySourceFeatures, "querySourceFeatures"),
|
||||
METHOD(&GeoJSONSource::getClusterChildren, "nativeGetClusterChildren"),
|
||||
METHOD(&GeoJSONSource::getClusterLeaves, "nativeGetClusterLeaves"),
|
||||
METHOD(&GeoJSONSource::getClusterExpansionZoom, "nativeGetClusterExpansionZoom"));
|
||||
METHOD(&GeoJSONSource::getClusterExpansionZoom, "nativeGetClusterExpansionZoom"),
|
||||
METHOD(&GeoJSONSource::isUpdateSynchronous, "nativeIsUpdateSynchronous"));
|
||||
}
|
||||
|
||||
void FeatureConverter::convertJson(std::shared_ptr<std::string> json, ActorRef<GeoJSONDataCallback> callback) {
|
||||
|
||||
@@ -89,6 +89,8 @@ private:
|
||||
template <class JNIType>
|
||||
void setCollectionSync(jni::JNIEnv&, const jni::Object<JNIType>&);
|
||||
|
||||
jboolean isUpdateSynchronous(jni::JNIEnv&);
|
||||
|
||||
}; // class GeoJSONSource
|
||||
|
||||
} // namespace android
|
||||
|
||||
Reference in New Issue
Block a user