diff options
Diffstat (limited to 'platform/android/src/style/sources/geojson_source.cpp')
-rw-r--r-- | platform/android/src/style/sources/geojson_source.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/platform/android/src/style/sources/geojson_source.cpp b/platform/android/src/style/sources/geojson_source.cpp index 90ef851eba..6d9ab9e22c 100644 --- a/platform/android/src/style/sources/geojson_source.cpp +++ b/platform/android/src/style/sources/geojson_source.cpp @@ -5,15 +5,15 @@ // Java -> C++ conversion #include "../android_conversion.hpp" #include "../conversion/filter.hpp" -#include "../conversion/geojson.hpp" +#include <mbgl/style/conversion.hpp> +#include <mbgl/style/conversion/geojson.hpp> +#include <mbgl/style/conversion/geojson_options.hpp> // C++ -> Java conversion #include "../../conversion/conversion.hpp" #include "../../conversion/collection.hpp" #include "../../geojson/conversion/feature.hpp" #include "../conversion/url_or_tileset.hpp" -#include <mbgl/style/conversion.hpp> -#include <mbgl/style/conversion/geojson_options.hpp> #include <string> @@ -29,7 +29,7 @@ namespace android { return style::GeoJSONOptions(); } Error error; - optional<style::GeoJSONOptions> result = convert<style::GeoJSONOptions>(Value(env, options), error); + optional<style::GeoJSONOptions> result = convert<style::GeoJSONOptions>(mbgl::android::Value(env, options), error); if (!result) { throw std::logic_error(error.message); } @@ -43,8 +43,10 @@ namespace android { ) { } - GeoJSONSource::GeoJSONSource(mbgl::style::GeoJSONSource& coreSource) - : Source(coreSource) { + GeoJSONSource::GeoJSONSource(jni::JNIEnv& env, + mbgl::style::Source& coreSource, + AndroidRendererFrontend& frontend) + : Source(env, coreSource, createJavaPeer(env), frontend) { } GeoJSONSource::~GeoJSONSource() = default; @@ -54,7 +56,7 @@ namespace android { // Convert the jni object Error error; - optional<GeoJSON> converted = convert<GeoJSON>(Value(env, json), error); + optional<GeoJSON> converted = convert<GeoJSON>(mbgl::android::Value(env, json), error); if(!converted) { mbgl::Log::Error(mbgl::Event::JNI, "Error setting geo json: " + error.message); return; @@ -118,9 +120,9 @@ namespace android { jni::Class<GeoJSONSource> GeoJSONSource::javaClass; - jni::jobject* GeoJSONSource::createJavaPeer(jni::JNIEnv& env) { + jni::Object<Source> GeoJSONSource::createJavaPeer(jni::JNIEnv& env) { static auto constructor = GeoJSONSource::javaClass.template GetConstructor<jni::jlong>(env); - return GeoJSONSource::javaClass.New(env, constructor, reinterpret_cast<jni::jlong>(this)); + return jni::Object<Source>(GeoJSONSource::javaClass.New(env, constructor, reinterpret_cast<jni::jlong>(this)).Get()); } void GeoJSONSource::registerNative(jni::JNIEnv& env) { |