diff --git a/indexer/map_object.cpp b/indexer/map_object.cpp index 5909d40c49..17891111f3 100644 --- a/indexer/map_object.cpp +++ b/indexer/map_object.cpp @@ -173,6 +173,11 @@ string MapObject::GetElevationFormatted() const return {}; } +bool MapObject::GetElevation(double & outElevationInMeters) const +{ + return strings::to_double(m_metadata.Get(feature::Metadata::FMD_ELE), outElevationInMeters); +} + string MapObject::GetWikipediaLink() const { return m_metadata.GetWikiURL(); } string MapObject::GetFlats() const { return m_metadata.Get(feature::Metadata::FMD_FLATS); } diff --git a/indexer/map_object.hpp b/indexer/map_object.hpp index d245bb52b1..eeef2421c2 100644 --- a/indexer/map_object.hpp +++ b/indexer/map_object.hpp @@ -83,6 +83,7 @@ public: int GetStars() const; /// @returns formatted elevation in feet or meters, or empty string. string GetElevationFormatted() const; + bool GetElevation(double & outElevationInMeters) const; /// @returns URL to Wikipedia or empty string. string GetWikipediaLink() const; string GetFlats() const; diff --git a/qt/editor_dialog.cpp b/qt/editor_dialog.cpp index 0db4ffb15e..846a85e165 100644 --- a/qt/editor_dialog.cpp +++ b/qt/editor_dialog.cpp @@ -135,7 +135,13 @@ EditorDialog::EditorDialog(QWidget * parent, osm::EditableMapObject & emo) case osm::Props::OpeningHours: v = emo.GetOpeningHours(); break; case osm::Props::Stars: v = strings::to_string(emo.GetStars()); break; case osm::Props::Operator: v = emo.GetOperator(); break; - case osm::Props::Elevation: v = emo.GetElevationFormatted(); break; + case osm::Props::Elevation: + { + double ele; + if (emo.GetElevation(ele)) + v = strings::to_string_dac(ele, 2); + } + break; case osm::Props::Wikipedia: v = emo.GetWikipedia(); break; case osm::Props::Flats: v = emo.GetFlats(); break; case osm::Props::BuildingLevels: v = emo.GetBuildingLevels(); break;