diff options
author | tobrun <tobrun.van.nuland@gmail.com> | 2018-12-20 19:34:55 +0100 |
---|---|---|
committer | Tobrun <tobrun@mapbox.com> | 2019-01-15 17:15:23 +0100 |
commit | 9ba0737e6a653cafec5d02982c06c31da970f6ca (patch) | |
tree | 7d6984708ee7518c60c738d380d5288b0d510792 /platform/android/src/math | |
parent | 59cfce30849615c5657c2079c5912dd61254a25e (diff) | |
download | qtlocation-mapboxgl-9ba0737e6a653cafec5d02982c06c31da970f6ca.tar.gz |
[android] - expose query feature extensions
Diffstat (limited to 'platform/android/src/math')
-rw-r--r-- | platform/android/src/math/math.cpp | 13 | ||||
-rw-r--r-- | platform/android/src/math/math.hpp | 26 |
2 files changed, 39 insertions, 0 deletions
diff --git a/platform/android/src/math/math.cpp b/platform/android/src/math/math.cpp new file mode 100644 index 0000000000..17d34caacb --- /dev/null +++ b/platform/android/src/math/math.cpp @@ -0,0 +1,13 @@ +#include "math.hpp" + +namespace mbgl { +namespace android { +namespace math { + +void registerNative(jni::JNIEnv& env) { + jni::Class<Math>::Singleton(env); +} + +} // namespace math +} // namespace android +} // namespace mbgl
\ No newline at end of file diff --git a/platform/android/src/math/math.hpp b/platform/android/src/math/math.hpp new file mode 100644 index 0000000000..c6a8549f10 --- /dev/null +++ b/platform/android/src/math/math.hpp @@ -0,0 +1,26 @@ +#pragma once + +#include <mbgl/util/noncopyable.hpp> + +#include <jni/jni.hpp> + +namespace mbgl { +namespace android { +namespace math { + +class Math : private mbgl::util::noncopyable { +public: + static constexpr auto Name() { return "java/lang/Math"; }; + + static jni::jdouble rint(jni::JNIEnv& env, const jni::jdouble value) { + static auto& javaClass = jni::Class<Math>::Singleton(env); + static auto method = javaClass.GetStaticMethod<jni::jdouble (jni::jdouble)>(env, "rint"); + return javaClass.Call(env, method, value); + }; +}; + +void registerNative(jni::JNIEnv&); + +} // namespace math +} // namespace android +} // namespace mbgl
\ No newline at end of file |