[ios] Fixed bug with building route with default search result.

This commit is contained in:
v.mikhaylenko 2015-11-09 15:32:48 +03:00
parent 40a0cd0ad6
commit 42339bf432

View file

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