diff options
Diffstat (limited to 'src/location/labs/qgeojson.cpp')
-rw-r--r-- | src/location/labs/qgeojson.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/location/labs/qgeojson.cpp b/src/location/labs/qgeojson.cpp index 7d609a75..163a140f 100644 --- a/src/location/labs/qgeojson.cpp +++ b/src/location/labs/qgeojson.cpp @@ -931,7 +931,8 @@ static QJsonObject exportFeature(const QVariantMap &featureMap) exportedFeature.insert(QStringLiteral("type"), QJsonValue(QStringLiteral("Feature"))); exportedFeature.insert(QStringLiteral("geometry"), geometryNodeValue); exportedFeature.insert(QStringLiteral("properties"), propertiesNodeValue); - exportedFeature.insert(QStringLiteral("id"), idNodeValue); + if (!idNodeValue.isNull()) // this value is optional + exportedFeature.insert(QStringLiteral("id"), idNodeValue); return exportedFeature; } @@ -1071,7 +1072,7 @@ QVariantList QGeoJson::importGeoJson(const QJsonDocument &geoJson) break; } QVariant bboxNodeValue = rootGeoJsonObject.value(QStringLiteral("bbox")); - if (bboxNodeValue != QVariant::Invalid) { + if (bboxNodeValue.isValid()) { parsedGeoJsonMap.insert(QStringLiteral("bbox"), bboxNodeValue); } returnedList.append(parsedGeoJsonMap); |