diff options
| author | Ivo van Dongen <info@ivovandongen.nl> | 2017-03-22 15:05:03 +0200 |
|---|---|---|
| committer | Ivo van Dongen <ivovandongen@users.noreply.github.com> | 2017-03-28 15:44:22 +0300 |
| commit | fa7489fb7ea8ec85cb746e0bc497518d72c638b9 (patch) | |
| tree | 477c100890466ca0093af9e101554dca530f9ae8 /platform/android/src/style/conversion/geojson.hpp | |
| parent | f70f604e5b99062a24764716ccdeda64c36320be (diff) | |
| download | qtlocation-mapboxgl-fa7489fb7ea8ec85cb746e0bc497518d72c638b9.tar.gz | |
[android] geojson conversion optimisation
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 <> |
