diff options
Diffstat (limited to 'platform/android/src/style/conversion/geojson.hpp')
| -rw-r--r-- | platform/android/src/style/conversion/geojson.hpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/platform/android/src/style/conversion/geojson.hpp b/platform/android/src/style/conversion/geojson.hpp index db474e8542..32a473b092 100644 --- a/platform/android/src/style/conversion/geojson.hpp +++ b/platform/android/src/style/conversion/geojson.hpp @@ -1,11 +1,8 @@ #pragma once -#include "../value.hpp" - #include <mapbox/geojson.hpp> #include <mbgl/style/conversion.hpp> #include <mbgl/style/conversion/geojson.hpp> -#include <mbgl/util/logging.hpp> #include <jni/jni.hpp> namespace mbgl { @@ -14,14 +11,13 @@ namespace conversion { template <> optional<GeoJSON> convertGeoJSON(const mbgl::android::Value& value, Error& error) { - // Value should be a string wrapped in an object - mbgl::android::Value jsonValue = value.get("data"); - if(value.isNull()) { + + if(value.isNull() || !value.isString()) { error = { "no json data found" }; return {}; } - return convertGeoJSON(value.get("data").toString(), error); + return convertGeoJSON(value.toString(), error); } template <> |
