Commit 76215f0a authored by Valentin Platzgummer's avatar Valentin Platzgummer

Measurement Complex Item load -> sync issue (tile alt = nan) solved

parent c508913f
...@@ -497,7 +497,7 @@ void MeasurementComplexItem::save(QJsonArray &planItems) { ...@@ -497,7 +497,7 @@ void MeasurementComplexItem::save(QJsonArray &planItems) {
// Variant names. // Variant names.
QJsonArray jsonVariantNames; QJsonArray jsonVariantNames;
for (auto const &name : _variantNames) { for (auto &&name : _variantNames) {
jsonVariantNames.append(name); jsonVariantNames.append(name);
} }
saveObject[variantNamesKey] = jsonVariantNames; saveObject[variantNamesKey] = jsonVariantNames;
...@@ -1209,7 +1209,7 @@ bool MeasurementComplexItem::stopEditing(bool doUpdate) { ...@@ -1209,7 +1209,7 @@ bool MeasurementComplexItem::stopEditing(bool doUpdate) {
_updateRoute(); _updateRoute();
} }
if (correct && isDifferent) { if (correct) {
_syncTiles(); _syncTiles();
} }
......
...@@ -40,8 +40,15 @@ bool GeoArea::loadFromJson(const QJsonObject &json, QString &errorString) { ...@@ -40,8 +40,15 @@ bool GeoArea::loadFromJson(const QJsonObject &json, QString &errorString) {
errorString)) { errorString)) {
qWarning() << errorString; qWarning() << errorString;
return false; return false;
} } else {
// set altitude to 0
for (int i = 0; i < this->count(); ++i) {
auto vertex = this->vertexCoordinate(i);
vertex.setAltitude(0);
this->adjustVertex(i, vertex);
}
}
return true; return true;
} }
......
...@@ -105,7 +105,7 @@ template <class T> bool toJson(const T &p, QJsonObject &value) { ...@@ -105,7 +105,7 @@ template <class T> bool toJson(const T &p, QJsonObject &value) {
p, traits::Type2Type<Components>()); // If T has no member altitude() p, traits::Type2Type<Components>()); // If T has no member altitude()
// replace it by 0.0; // replace it by 0.0;
value[altKey] = altitude; value[altKey] = double(altitude);
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment