-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add expression conversion, getters, tests #11352
Conversation
147093e
to
b98f2cc
Compare
b98f2cc
to
09ee6e3
Compare
619a7e4
to
21f8838
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Two general remarks (maybe a follow-up):
- Let's make all new jni bindings use the high-level abstractions as much as possible (eg, the new templates and evaluator)
- There are some classes in
platform/android/src/gson
that are a good place to add much of the conversion now inline in the evaluator.
return object; | ||
} | ||
|
||
jni::jobject*operator()(const std::vector<mapbox::geometry::value> values) const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space after star
return jarray; | ||
} | ||
|
||
jni::jobject*operator()(const std::unordered_map<std::string, mapbox::geometry::value> value) const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space after star
Result<jni::jobject*> operator()(jni::JNIEnv& env, const mapbox::geometry::value& value) const { | ||
JsonEvaluator evaluator { env } ; | ||
jni::jobject* converted = mapbox::geometry::value::visit(value, evaluator); | ||
return {converted}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spaces around converted
@@ -39,7 +40,7 @@ class PropertyValueEvaluator { | |||
} | |||
|
|||
jni::jobject* operator()(const mbgl::style::CompositeFunction<T> &value) const { | |||
return *convert<jni::jobject*, mbgl::style::CompositeFunction<T>>(env, value); | |||
return *convert<jni::jobject*, mbgl::style::CompositeFunction<T>>(env, value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accidental space?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one was intentional 😄there was a space missing, see https://github.com/mapbox/mapbox-gl-native/blob/master/platform/android/src/style/conversion/property_value.hpp#L41
@@ -7,6 +7,7 @@ | |||
#include "../../conversion/constant.hpp" | |||
#include "types.hpp" | |||
#include "function.hpp" | |||
#include "json.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we name this gson.hpp?
21f8838
to
87fa4de
Compare
Closes #10721, #10722, #11247, #10868
This PR adds accessors for expressions and removes the old API for doing DDS.