summaryrefslogtreecommitdiff
path: root/platform/android/src/geojson/feature.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/src/geojson/feature.cpp')
-rw-r--r--platform/android/src/geojson/feature.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/platform/android/src/geojson/feature.cpp b/platform/android/src/geojson/feature.cpp
index 767b145a89..8d30404a50 100644
--- a/platform/android/src/geojson/feature.cpp
+++ b/platform/android/src/geojson/feature.cpp
@@ -18,11 +18,12 @@ mbgl::Feature Feature::convert(jni::JNIEnv& env, const jni::Object<Feature>& jFe
auto jId = jFeature.Call(env, id);
+ using mbid = mapbox::feature::identifier;
+
return mbgl::Feature {
Geometry::convert(env, jFeature.Call(env, geometry)),
JsonObject::convert(env, jFeature.Call(env, properties)),
- jId ? std::experimental::optional<mapbox::geometry::identifier>(jni::Make<std::string>(env, jId))
- : std::experimental::nullopt
+ jId ? mbid { jni::Make<std::string>(env, jId) } : mbid { mapbox::feature::null_value }
};
}
@@ -41,7 +42,11 @@ public:
}
std::string operator()(const std::nullptr_t&) const {
- return "";
+ return {};
+ }
+
+ std::string operator()(const mapbox::feature::null_value_t&) const {
+ return {};
}
};
@@ -52,7 +57,7 @@ jni::Local<jni::Object<Feature>> convertFeature(jni::JNIEnv& env, const mbgl::Fe
return javaClass.Call(env, method,
Geometry::New(env, value.geometry),
JsonObject::New(env, value.properties),
- jni::Make<jni::String>(env, value.id ? value.id.value().match(FeatureIdVisitor()) : ""));
+ jni::Make<jni::String>(env, value.id.is<mbgl::NullValue>() ? std::string {} : value.id.match(FeatureIdVisitor())));
}
jni::Local<jni::Array<jni::Object<Feature>>> Feature::convert(jni::JNIEnv& env, const std::vector<mbgl::Feature>& value) {
@@ -71,4 +76,4 @@ void Feature::registerNative(jni::JNIEnv& env) {
} // namespace geojson
} // namespace android
-} // namespace mbgl \ No newline at end of file
+} // namespace mbgl