diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-05-05 16:31:03 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-05-08 13:48:57 -0700 |
commit | baaae99a03202641ae5b8024e57b691fe61a6688 (patch) | |
tree | 459045e56197696aa1312594f1e452b03931775d /platform/qt/src/qmapboxgl.cpp | |
parent | e34d8b5c802186008e49364668e4a7bd5668d0fd (diff) | |
download | qtlocation-mapboxgl-baaae99a03202641ae5b8024e57b691fe61a6688.tar.gz |
[core, android] Factor JSON string conversions
This adds a `convertJSON` template, to be used like:
Error error
optional<Foo> foo = convertJSON<Foo>(string, error);
Internally, it parses the string with RapidJSON and then calls `convert<Foo>(parsed, error)`.
While here, rationalize GeoJSON converters and fix error handling for Tileset conversion in OfflineDownload.
Diffstat (limited to 'platform/qt/src/qmapboxgl.cpp')
-rw-r--r-- | platform/qt/src/qmapboxgl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/platform/qt/src/qmapboxgl.cpp b/platform/qt/src/qmapboxgl.cpp index edb8afa28a..ce7e237afb 100644 --- a/platform/qt/src/qmapboxgl.cpp +++ b/platform/qt/src/qmapboxgl.cpp @@ -1303,7 +1303,7 @@ void QMapboxGL::updateSource(const QString &id, const QVariantMap ¶ms) if (params.contains("data")) { Error error; - auto result = convertGeoJSON(params["data"], error); + auto result = convert<mbgl::GeoJSON>(params["data"], error); if (result) { sourceGeoJSON->setGeoJSON(*result); } |