forked from organicmaps/organicmaps
[ios] Fixed bug with building route with default search result.
This commit is contained in:
parent
40a0cd0ad6
commit
42339bf432
1 changed files with 8 additions and 12 deletions
|
@ -177,20 +177,16 @@ extern NSString * const kSearchStateKey = @"SearchStateKey";
|
|||
auto & f = GetFramework();
|
||||
f.SaveSearchQuery(query);
|
||||
MapsAppDelegate * a = MapsAppDelegate.theApp;
|
||||
if (a.routingPlaneMode != MWMRoutingPlaneModeNone)
|
||||
{
|
||||
MWMRoutePoint const p = {result.GetFeatureCenter(), @(result.GetString())};
|
||||
if (a.routingPlaneMode == MWMRoutingPlaneModeSearchSource)
|
||||
[self.delegate buildRouteFrom:p];
|
||||
else
|
||||
[self.delegate buildRouteTo:p];
|
||||
if (!IPAD)
|
||||
a.routingPlaneMode = MWMRoutingPlaneModePlacePage;
|
||||
}
|
||||
MWMRoutingPlaneMode const m = a.routingPlaneMode;
|
||||
MWMRoutePoint const p = {result.GetFeatureCenter(), @(result.GetString())};
|
||||
if (m == MWMRoutingPlaneModeSearchSource)
|
||||
[self.delegate buildRouteFrom:p];
|
||||
else if (m == MWMRoutingPlaneModeSearchDestination)
|
||||
[self.delegate buildRouteTo:p];
|
||||
else
|
||||
{
|
||||
f.ShowSearchResult(result);
|
||||
}
|
||||
if (!IPAD)
|
||||
a.routingPlaneMode = MWMRoutingPlaneModePlacePage;
|
||||
self.state = MWMSearchManagerStateHidden;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue