From 97d1793a97a0f10c3be72bd0d9d82fe94e973dae Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Fri, 4 Mar 2016 11:07:47 +0300 Subject: [PATCH] XMLFeature::GetMercatorCenter. --- editor/xml_feature.cpp | 5 +++++ editor/xml_feature.hpp | 1 + 2 files changed, 6 insertions(+) diff --git a/editor/xml_feature.cpp b/editor/xml_feature.cpp index 30e5332edf..db8e988312 100644 --- a/editor/xml_feature.cpp +++ b/editor/xml_feature.cpp @@ -161,6 +161,11 @@ void XMLFeature::ApplyPatch(XMLFeature const & featureWithChanges) }); } +m2::PointD XMLFeature::GetMercatorCenter() const +{ + return MercatorBounds::FromLatLon(GetLatLonFromNode(GetRootNode())); +} + ms::LatLon XMLFeature::GetCenter() const { return GetLatLonFromNode(GetRootNode()); diff --git a/editor/xml_feature.hpp b/editor/xml_feature.hpp index 61ec1106ca..be91ce5181 100644 --- a/editor/xml_feature.hpp +++ b/editor/xml_feature.hpp @@ -62,6 +62,7 @@ public: /// @returns true only if it is a way and it is closed (area). bool IsArea() const; + m2::PointD GetMercatorCenter() const; ms::LatLon GetCenter() const; void SetCenter(ms::LatLon const & ll); void SetCenter(m2::PointD const & mercatorCenter);