use of net.osmand.plus.mapmarkers.MarkersPlanRouteContext in project Osmand by osmandapp.
the class MapActivityActions method getRouteMode.
public ApplicationMode getRouteMode(LatLon from) {
MarkersPlanRouteContext planRouteContext = mapActivity.getMyApplication().getMapMarkersHelper().getPlanRouteContext();
if (planRouteContext.isNavigationFromMarkers() && planRouteContext.getSnappedMode() != ApplicationMode.DEFAULT) {
planRouteContext.setNavigationFromMarkers(false);
return planRouteContext.getSnappedMode();
}
ApplicationMode mode = settings.DEFAULT_APPLICATION_MODE.get();
ApplicationMode selected = settings.APPLICATION_MODE.get();
if (selected != ApplicationMode.DEFAULT) {
mode = selected;
} else if (mode == ApplicationMode.DEFAULT) {
mode = ApplicationMode.CAR;
if (settings.LAST_ROUTING_APPLICATION_MODE != null && settings.LAST_ROUTING_APPLICATION_MODE != ApplicationMode.DEFAULT) {
mode = settings.LAST_ROUTING_APPLICATION_MODE;
}
}
return mode;
}
Aggregations