mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-08 05:17:56 +00:00
[ios] fix route building error while searching when current location in none
Fixes issue https://github.com/organicmaps/organicmaps/issues/10606 Signed-off-by: Kiryl Kaveryn <kirylkaveryn@gmail.com>
This commit is contained in:
committed by
Konstantin Pastbin
parent
7be49ab00a
commit
8a331c4c67
@@ -36,16 +36,16 @@
|
||||
if (result.IsSuggest())
|
||||
_suggestion = @(result.GetSuggestionString().c_str());
|
||||
|
||||
auto const & pivot = result.GetFeatureCenter();
|
||||
_point = CGPointMake(pivot.x, pivot.y);
|
||||
auto const location = mercator::ToLatLon(pivot);
|
||||
_coordinate = CLLocationCoordinate2DMake(location.m_lat, location.m_lon);
|
||||
|
||||
CLLocation * lastLocation = [MWMLocationManager lastLocation];
|
||||
if (lastLocation && result.HasPoint()) {
|
||||
double distanceInMeters = mercator::DistanceOnEarth(lastLocation.mercator, result.GetFeatureCenter());
|
||||
std::string distanceStr = platform::Distance::CreateFormatted(distanceInMeters).ToString();
|
||||
_distanceText = @(distanceStr.c_str());
|
||||
|
||||
auto const & pivot = result.GetFeatureCenter();
|
||||
_point = CGPointMake(pivot.x, pivot.y);
|
||||
auto const location = mercator::ToLatLon(pivot);
|
||||
_coordinate = CLLocationCoordinate2DMake(location.m_lat, location.m_lon);
|
||||
} else {
|
||||
_distanceText = nil;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user