Search in sources :

Example 1 with MarkersPlanRouteContext

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;
}
Also used : MarkersPlanRouteContext(net.osmand.plus.mapmarkers.MarkersPlanRouteContext) ApplicationMode(net.osmand.plus.ApplicationMode)

Aggregations

ApplicationMode (net.osmand.plus.ApplicationMode)1 MarkersPlanRouteContext (net.osmand.plus.mapmarkers.MarkersPlanRouteContext)1