mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-28 17:03:38 +00:00
@@ -1,16 +1,20 @@
|
||||
#include "map/gps_tracker.hpp"
|
||||
#include "map/framework.hpp"
|
||||
|
||||
#include "platform/platform.hpp"
|
||||
#include "platform/settings.hpp"
|
||||
|
||||
#include "base/file_name_utils.hpp"
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "defines.hpp"
|
||||
|
||||
using namespace std::chrono;
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
std::string_view constexpr kEnabledKey = "GpsTrackingEnabled";
|
||||
char const kEnabledKey[] = "GpsTrackingEnabled";
|
||||
|
||||
inline std::string GetFilePath()
|
||||
{
|
||||
@@ -68,6 +72,11 @@ bool GpsTracker::IsEmpty() const
|
||||
return m_track.IsEmpty();
|
||||
}
|
||||
|
||||
size_t GpsTracker::GetTrackSize() const
|
||||
{
|
||||
return m_track.GetSize();
|
||||
}
|
||||
|
||||
TrackStatistics GpsTracker::GetTrackStatistics() const
|
||||
{
|
||||
return m_track.GetTrackStatistics();
|
||||
@@ -94,3 +103,9 @@ void GpsTracker::OnLocationUpdated(location::GpsInfo const & info)
|
||||
return;
|
||||
m_track.AddPoint(info);
|
||||
}
|
||||
|
||||
void GpsTracker::ForEachTrackPoint(GpsTrackCallback const & callback) const
|
||||
{
|
||||
CHECK(callback != nullptr, ("Callback should be provided"));
|
||||
m_track.ForEachPoint(callback);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user