Files
comaps/iphone/Maps/Core/Location/MWMLocationHelpers.h
Konstantin Pastbin e3e4a1985a Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run:
  git remote add om-historic [om-historic.git repo url]
  git fetch --tags om-historic
  git replace squashed-history historic-commits
2025-05-08 21:10:51 +07:00

39 lines
1.2 KiB
Objective-C

#import "MWMMyPositionMode.h"
#include "platform/localization.hpp"
#include "platform/location.hpp"
#include "platform/distance.hpp"
#include "geometry/mercator.hpp"
namespace location_helpers
{
static inline NSString * formattedDistance(double const & meters) {
if (meters < 0.)
return nil;
return @(platform::Distance::CreateFormatted(meters).ToString().c_str());
}
static inline ms::LatLon ToLatLon(m2::PointD const & p) { return mercator::ToLatLon(p); }
static inline m2::PointD ToMercator(CLLocationCoordinate2D const & l)
{
return mercator::FromLatLon(l.latitude, l.longitude);
}
static inline m2::PointD ToMercator(ms::LatLon const & l) { return mercator::FromLatLon(l); }
static inline MWMMyPositionMode mwmMyPositionMode(location::EMyPositionMode mode)
{
switch (mode)
{
case location::EMyPositionMode::PendingPosition: return MWMMyPositionModePendingPosition;
case location::EMyPositionMode::NotFollowNoPosition: return MWMMyPositionModeNotFollowNoPosition;
case location::EMyPositionMode::NotFollow: return MWMMyPositionModeNotFollow;
case location::EMyPositionMode::Follow: return MWMMyPositionModeFollow;
case location::EMyPositionMode::FollowAndRotate: return MWMMyPositionModeFollowAndRotate;
}
}
} // namespace location_helpers