diff options
author | Arsentiy Milchakov <milcars@mapswithme.com> | 2018-10-30 18:16:40 +0300 |
---|---|---|
committer | Roman Kuznetsov <r.kuznetsow@gmail.com> | 2018-10-31 16:01:09 +0300 |
commit | b415753017fb208eea396e1b2c274fd385d0c147 (patch) | |
tree | 20af2d652126c71e3e1af5807ccf81739b936643 /coding | |
parent | 9308c996d5a5f02e30f3f509f7988ceafa11bb0b (diff) |
[eye] save mercator pos instead of latlon
Diffstat (limited to 'coding')
-rw-r--r-- | coding/serdes_json.hpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/coding/serdes_json.hpp b/coding/serdes_json.hpp index 65e4565027..4541bfb2ee 100644 --- a/coding/serdes_json.hpp +++ b/coding/serdes_json.hpp @@ -1,6 +1,7 @@ #pragma once #include "geometry/latlon.hpp" +#include "geometry/point2d.hpp" #include "base/exception.hpp" #include "base/scope_guard.hpp" @@ -133,6 +134,14 @@ public: (*this)(static_cast<std::underlying_type_t<T>>(t), name); } + void operator()(m2::PointD const & p, char const * name = nullptr) + { + NewScopeWith(base::NewJSONObject(), name, [this, &p] { + (*this)(p.x, "x"); + (*this)(p.y, "y"); + }); + } + void operator()(ms::LatLon const & ll, char const * name = nullptr) { NewScopeWith(base::NewJSONObject(), name, [this, &ll] { @@ -325,6 +334,14 @@ public: t = static_cast<T>(res); } + void operator()(m2::PointD & p, char const * name = nullptr) + { + json_t * outerContext = SaveContext(name); + (*this)(p.x, "x"); + (*this)(p.y, "y"); + RestoreContext(outerContext); + } + void operator()(ms::LatLon & ll, char const * name = nullptr) { json_t * outerContext = SaveContext(name); |