diff options
author | ExMix <rahuba.youri@mapswithme.com> | 2014-09-12 11:15:45 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:27:07 +0300 |
commit | f95b30a7af92770bf89d88c882417a7ab557be41 (patch) | |
tree | 555140a29b43b66a88da3df070e95048db2390ff /map/track.cpp | |
parent | a14ee872549bb849a257a5ebdea1845ca2d92690 (diff) |
[core] check routing session state.
Diffstat (limited to 'map/track.cpp')
-rw-r--r-- | map/track.cpp | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/map/track.cpp b/map/track.cpp index 85ec8ab00e..50b34684ff 100644 --- a/map/track.cpp +++ b/map/track.cpp @@ -94,7 +94,7 @@ double Track::GetLengthMeters() const { double res = 0.0; - PolylineD::IterT i = m_polyline.Begin(); + PolylineD::TIter i = m_polyline.Begin(); double lat1 = MercatorBounds::YToLat(i->y); double lon1 = MercatorBounds::XToLon(i->x); for (++i; i != m_polyline.End(); ++i) @@ -111,18 +111,7 @@ double Track::GetLengthMeters() const double Track::GetShortestSquareDistance(m2::PointD const & point) const { - double res = numeric_limits<double>::max(); - m2::DistanceToLineSquare<m2::PointD> d; - - typedef PolylineD::IterT IterT; - IterT i = m_polyline.Begin(); - for (IterT j = i+1; j != m_polyline.End(); ++i, ++j) - { - d.SetBounds(*i, *j); - res = min(res, d(point)); - } - - return res; + return m_polyline.GetShortestSquareDistance(point); } void Track::Swap(Track & rhs) |