diff options
Diffstat (limited to 'platform/android/src/style/conversion/property_value.hpp')
-rw-r--r-- | platform/android/src/style/conversion/property_value.hpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/platform/android/src/style/conversion/property_value.hpp b/platform/android/src/style/conversion/property_value.hpp index a58cf975a7..902d1e80b2 100644 --- a/platform/android/src/style/conversion/property_value.hpp +++ b/platform/android/src/style/conversion/property_value.hpp @@ -2,6 +2,7 @@ #include <mbgl/style/property_value.hpp> #include <mbgl/style/data_driven_property_value.hpp> +#include <mbgl/style/heatmap_color_property_value.hpp> #include "../../conversion/conversion.hpp" #include "../../conversion/constant.hpp" #include "types.hpp" @@ -30,15 +31,15 @@ public: } jni::jobject* operator()(const mbgl::style::CameraFunction<T> &value) const { - return *convert<jni::jobject*, mbgl::style::CameraFunction<T>>(env, value); + return *convert<jni::Object<android::gson::JsonElement>, mbgl::style::CameraFunction<T>>(env, value); } jni::jobject* operator()(const mbgl::style::SourceFunction<T> &value) const { - return *convert<jni::jobject*, mbgl::style::SourceFunction<T>>(env, value); + return *convert<jni::Object<android::gson::JsonElement>, mbgl::style::SourceFunction<T>>(env, value); } jni::jobject* operator()(const mbgl::style::CompositeFunction<T> &value) const { - return *convert<jni::jobject*, mbgl::style::CompositeFunction<T>>(env, value); + return *convert<jni::Object<android::gson::JsonElement>, mbgl::style::CompositeFunction<T>>(env, value); } private: @@ -70,6 +71,18 @@ struct Converter<jni::jobject*, mbgl::style::DataDrivenPropertyValue<T>> { } }; +/** + * Convert core heat map color property value to java + */ +template <> +struct Converter<jni::jobject*, mbgl::style::HeatmapColorPropertyValue> { + + Result<jni::jobject*> operator()(jni::JNIEnv& env, const mbgl::style::HeatmapColorPropertyValue value) const { + PropertyValueEvaluator<mbgl::style::HeatmapColorPropertyValue> evaluator(env); + return *convert<jni::jobject*>(env, value.evaluate(evaluator)); + } +}; + } // namespace conversion } // namespace android } // namespace mbgl |