[map] [platform] review fixes

Signed-off-by: Kiryl Kaveryn <kirylkaveryn@gmail.com>
This commit is contained in:
Kiryl Kaveryn 2024-12-17 19:46:20 +04:00 committed by Viktor Havaka
parent bfdae6bc79
commit 01890abc83
4 changed files with 8 additions and 9 deletions

View file

@ -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(vector<pair<size_t, location::Gps
m_drapeEngine->UpdateGpsTrackPoints(std::move(pointsAdd), std::move(indicesRemove));
if (m_trackRecordingUpdateHandler)
m_trackRecordingUpdateHandler(std::move(trackInfo));
m_trackRecordingUpdateHandler(trackInfo);
}
void Framework::MarkMapStyle(MapStyle mapStyle)

View file

@ -303,7 +303,7 @@ void GpsTrack::NotifyCallback(pair<size_t, size_t> const & addedIds, pair<size_t
if (toAdd.empty())
return; // nothing to send
m_callback(std::move(toAdd), make_pair(kInvalidId, kInvalidId), std::move(m_collection->GetTrackInfo()));
m_callback(std::move(toAdd), make_pair(kInvalidId, kInvalidId), m_collection->GetTrackInfo());
}
else
{
@ -324,6 +324,6 @@ void GpsTrack::NotifyCallback(pair<size_t, size_t> const & addedIds, pair<size_t
if (toAdd.empty() && evictedIds.first == kInvalidId)
return; // nothing to send
m_callback(std::move(toAdd), evictedIds, std::move(m_collection->GetTrackInfo()));
m_callback(std::move(toAdd), evictedIds, m_collection->GetTrackInfo());
}
}

View file

@ -2,7 +2,7 @@
#include "base/assert.hpp"
#include "geometry/mercator.hpp"
#include "geometry/distance_on_sphere.hpp"
#include <algorithm>
@ -59,7 +59,7 @@ std::pair<size_t, size_t> GpsTrackCollection::Add(std::vector<TItem> 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;

View file

@ -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