forked from organicmaps/organicmaps
Removing intermediate points in not-vehicle routing mode
This commit is contained in:
parent
2f4c5b5c64
commit
44b578492f
3 changed files with 13 additions and 12 deletions
|
@ -289,9 +289,12 @@ public class RoutingController implements TaxiManager.TaxiListener
|
|||
mLastBuildProgress = 0;
|
||||
mInternetConnected = ConnectionState.isConnected();
|
||||
|
||||
// Now only car routing supports intermediate points.
|
||||
if (!isVehicleRouterType())
|
||||
removeIntermediatePoints();
|
||||
|
||||
if (isTaxiRouterType())
|
||||
{
|
||||
removeIntermediatePoints();
|
||||
if (!mInternetConnected)
|
||||
{
|
||||
completeTaxiRequest();
|
||||
|
|
|
@ -177,16 +177,9 @@ char const * kRenderAltitudeImagesQueueLabel = "mapsme.mwmrouter.renderAltitudeI
|
|||
{
|
||||
if (type == self.type)
|
||||
return;
|
||||
if (type == MWMRouterTypeTaxi)
|
||||
{
|
||||
auto const routePoints = GetFramework().GetRoutingManager().GetRoutePoints();
|
||||
for (auto const & point : routePoints)
|
||||
{
|
||||
if (point.m_pointType != RouteMarkType::Intermediate)
|
||||
continue;
|
||||
[self removePoint:RouteMarkType::Intermediate intermediateIndex:point.m_intermediateIndex];
|
||||
}
|
||||
}
|
||||
// Now only car routing supports intermediate points.
|
||||
if (type != MWMRouterTypeVehicle)
|
||||
GetFramework().GetRoutingManager().RemoveIntermediateRoutePoints();
|
||||
[self doStop:NO];
|
||||
GetFramework().GetRoutingManager().SetRouter(coreRouterType(type));
|
||||
}
|
||||
|
|
|
@ -270,7 +270,7 @@ void RoutingManager::SetRouterImpl(routing::RouterType type)
|
|||
m_routingSession.SetRoutingSettings(routing::GetCarRoutingSettings());
|
||||
}
|
||||
|
||||
m_routingSession.SetRouter(move(router), move(fetcher));
|
||||
m_routingSession.SetRouter(std::move(router), std::move(fetcher));
|
||||
m_currentRouterType = type;
|
||||
}
|
||||
|
||||
|
@ -438,6 +438,11 @@ bool RoutingManager::CouldAddIntermediatePoint() const
|
|||
{
|
||||
if (!IsRoutingActive())
|
||||
return false;
|
||||
|
||||
// Now only car routing supports intermediate points.
|
||||
if (m_currentRouterType != routing::RouterType::Vehicle)
|
||||
return false;
|
||||
|
||||
UserMarkControllerGuard guard(*m_bmManager, UserMarkType::ROUTING_MARK);
|
||||
return guard.m_controller.GetUserMarkCount() <
|
||||
static_cast<size_t>(RoutePointsLayout::kMaxIntermediatePointsCount + 2);
|
||||
|
|
Loading…
Add table
Reference in a new issue