From 01890abc837608a7218167a1ba7d70a880bf27f2 Mon Sep 17 00:00:00 2001 From: Kiryl Kaveryn Date: Tue, 17 Dec 2024 19:46:20 +0400 Subject: [PATCH] [map] [platform] review fixes Signed-off-by: Kiryl Kaveryn --- map/framework.cpp | 4 ++-- map/gps_track.cpp | 4 ++-- map/gps_track_collection.cpp | 4 ++-- platform/location.hpp | 5 ++--- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/map/framework.cpp b/map/framework.cpp index a1e97ab614..734ea57059 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -1728,7 +1728,7 @@ void Framework::SetTrackRecordingUpdateHandler(TrackRecordingUpdateHandler && tr { m_trackRecordingUpdateHandler = std::move(trackRecordingDidUpdate); if (m_trackRecordingUpdateHandler) - m_trackRecordingUpdateHandler(std::move(GpsTracker::Instance().GetTrackInfo())); + m_trackRecordingUpdateHandler(GpsTracker::Instance().GetTrackInfo()); } void Framework::StopTrackRecording() @@ -1789,7 +1789,7 @@ void Framework::OnUpdateGpsTrackPointsCallback(vectorUpdateGpsTrackPoints(std::move(pointsAdd), std::move(indicesRemove)); if (m_trackRecordingUpdateHandler) - m_trackRecordingUpdateHandler(std::move(trackInfo)); + m_trackRecordingUpdateHandler(trackInfo); } void Framework::MarkMapStyle(MapStyle mapStyle) diff --git a/map/gps_track.cpp b/map/gps_track.cpp index 4164af33eb..c808753cda 100644 --- a/map/gps_track.cpp +++ b/map/gps_track.cpp @@ -303,7 +303,7 @@ void GpsTrack::NotifyCallback(pair const & addedIds, pairGetTrackInfo())); + m_callback(std::move(toAdd), make_pair(kInvalidId, kInvalidId), m_collection->GetTrackInfo()); } else { @@ -324,6 +324,6 @@ void GpsTrack::NotifyCallback(pair const & addedIds, pairGetTrackInfo())); + m_callback(std::move(toAdd), evictedIds, m_collection->GetTrackInfo()); } } diff --git a/map/gps_track_collection.cpp b/map/gps_track_collection.cpp index 42ca892e6b..f39c2e964c 100644 --- a/map/gps_track_collection.cpp +++ b/map/gps_track_collection.cpp @@ -2,7 +2,7 @@ #include "base/assert.hpp" -#include "geometry/mercator.hpp" +#include "geometry/distance_on_sphere.hpp" #include @@ -59,7 +59,7 @@ std::pair GpsTrackCollection::Add(std::vector const & ite else { auto const & lastItem = m_items.back(); - m_trackInfo.m_length += mercator::DistanceOnEarth(lastItem.GetPoint(), item.GetPoint()); + m_trackInfo.m_length += ms::DistanceOnEarth(lastItem.GetLatLon(), item.GetLatLon()); m_trackInfo.m_duration = item.m_timestamp - m_items.front().m_timestamp; auto const deltaAltitude = item.m_altitude - lastItem.m_altitude; diff --git a/platform/location.hpp b/platform/location.hpp index c0d86fa1e9..afed47d4a6 100644 --- a/platform/location.hpp +++ b/platform/location.hpp @@ -1,7 +1,7 @@ #pragma once #include "geometry/point2d.hpp" -#include "geometry/mercator.hpp" +#include "geometry/latlon.hpp" #include "base/base.hpp" @@ -61,8 +61,7 @@ namespace location bool HasBearing() const { return m_bearing >= 0.0; } bool HasSpeed() const { return m_speed >= 0.0; } bool HasVerticalAccuracy() const { return m_verticalAccuracy >= 0.0; } - - m2::PointD GetPoint() const { return mercator::FromLatLon(m_latitude, m_longitude); } + ms::LatLon GetLatLon() const { return {m_latitude, m_longitude}; } }; class CompassInfo