Refactor RoutingHelper (reduce class code lines)
This commit is contained in:
parent
e00fad1736
commit
cf916a5da7
32 changed files with 966 additions and 797 deletions
|
@ -80,6 +80,7 @@ import net.osmand.plus.routing.IRoutingDataUpdateListener;
|
|||
import net.osmand.plus.routing.RouteCalculationResult.NextDirectionInfo;
|
||||
import net.osmand.plus.routing.RouteDirectionInfo;
|
||||
import net.osmand.plus.routing.RoutingHelper;
|
||||
import net.osmand.plus.routing.RoutingHelperUtils;
|
||||
import net.osmand.plus.routing.VoiceRouter;
|
||||
import net.osmand.plus.settings.backend.ApplicationMode;
|
||||
import net.osmand.plus.settings.backend.ApplicationMode.ApplicationModeBean;
|
||||
|
@ -1803,7 +1804,7 @@ public class OsmandAidlApi {
|
|||
if (ni.directionInfo != null && ni.directionInfo.getTurnType() != null) {
|
||||
TurnType tt = ni.directionInfo.getTurnType();
|
||||
RouteDirectionInfo a = ni.directionInfo;
|
||||
bundle.putString(prefix + PARAM_NT_DIRECTION_NAME, RoutingHelper.formatStreetName(a.getStreetName(), a.getRef(), a.getDestinationName(), ""));
|
||||
bundle.putString(prefix + PARAM_NT_DIRECTION_NAME, RoutingHelperUtils.formatStreetName(a.getStreetName(), a.getRef(), a.getDestinationName(), ""));
|
||||
bundle.putString(prefix + PARAM_NT_DIRECTION_TURN, tt.toXmlString());
|
||||
bundle.putFloat(prefix + PARAM_NT_DIRECTION_ANGLE, tt.getTurnAngle());
|
||||
bundle.putBoolean(prefix + PARAM_NT_DIRECTION_POSSIBLY_LEFT, tt.isPossibleLeftTurn());
|
||||
|
|
|
@ -39,7 +39,7 @@ import net.osmand.data.LatLon;
|
|||
import net.osmand.data.QuadPoint;
|
||||
import net.osmand.plus.TargetPointsHelper.TargetPoint;
|
||||
import net.osmand.plus.routing.RoutingHelper;
|
||||
import net.osmand.plus.routing.RoutingHelper.RouteSegmentSearchResult;
|
||||
import net.osmand.plus.routing.RouteSegmentSearchResult;
|
||||
import net.osmand.plus.settings.backend.ApplicationMode;
|
||||
import net.osmand.plus.settings.backend.OsmandSettings;
|
||||
import net.osmand.router.RouteSegmentResult;
|
||||
|
@ -154,7 +154,7 @@ public class OsmAndLocationProvider implements SensorEventListener {
|
|||
startLocation.setTime(ms);
|
||||
}
|
||||
RouteSegmentSearchResult searchResult =
|
||||
RoutingHelper.searchRouteSegment(currentLocation.getLatitude(), currentLocation.getLongitude(), -1, roads);
|
||||
RouteSegmentSearchResult.searchRouteSegment(currentLocation.getLatitude(), currentLocation.getLongitude(), -1, roads);
|
||||
if (searchResult != null) {
|
||||
currentRoad = searchResult.getRoadIndex();
|
||||
currentSegment = searchResult.getSegmentIndex();
|
||||
|
|
|
@ -12,6 +12,7 @@ import net.osmand.data.PointDescription;
|
|||
import net.osmand.plus.GeocodingLookupService.AddressLookupRequest;
|
||||
import net.osmand.plus.routing.RouteProvider.RouteService;
|
||||
import net.osmand.plus.routing.RoutingHelper;
|
||||
import net.osmand.plus.routing.RoutingHelperUtils;
|
||||
import net.osmand.plus.settings.backend.ApplicationMode;
|
||||
import net.osmand.plus.settings.backend.OsmAndAppCustomization.OsmAndAppCustomizationListener;
|
||||
import net.osmand.plus.settings.backend.OsmandSettings;
|
||||
|
@ -444,7 +445,7 @@ public class TargetPointsHelper {
|
|||
Location lastKnownLocation = ctx.getLocationProvider().getLastKnownLocation();
|
||||
LatLon latLon = lastKnownLocation != null ?
|
||||
new LatLon(lastKnownLocation.getLatitude(), lastKnownLocation.getLongitude()) : null;
|
||||
routingHelper.checkAndUpdateStartLocation(latLon);
|
||||
RoutingHelperUtils.checkAndUpdateStartLocation(ctx, latLon);
|
||||
setMyLocationPoint(latLon, false, null);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -126,7 +126,7 @@ import net.osmand.plus.routepreparationmenu.MapRouteInfoMenu;
|
|||
import net.osmand.plus.routepreparationmenu.MapRouteInfoMenuFragment;
|
||||
import net.osmand.plus.routing.IRouteInformationListener;
|
||||
import net.osmand.plus.routing.RoutingHelper;
|
||||
import net.osmand.plus.routing.RoutingHelper.RouteCalculationProgressCallback;
|
||||
import net.osmand.plus.routing.RouteCalculationProgressCallback;
|
||||
import net.osmand.plus.routing.TransportRoutingHelper.TransportRouteCalculationProgressCallback;
|
||||
import net.osmand.plus.search.QuickSearchDialogFragment;
|
||||
import net.osmand.plus.search.QuickSearchDialogFragment.QuickSearchTab;
|
||||
|
@ -553,7 +553,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
|
|||
allowPrivate.setModeValue(mode, true);
|
||||
}
|
||||
}
|
||||
getRoutingHelper().recalculateRouteDueToSettingsChange();
|
||||
getRoutingHelper().onSettingsChanged(true);
|
||||
}
|
||||
});
|
||||
dlg.setNegativeButton(R.string.shared_string_no, null);
|
||||
|
|
|
@ -25,6 +25,7 @@ import net.osmand.plus.dashboard.DashboardOnMap;
|
|||
import net.osmand.plus.mapcontextmenu.MapContextMenu;
|
||||
import net.osmand.plus.mapcontextmenu.other.TrackDetailsMenu;
|
||||
import net.osmand.plus.routing.RoutingHelper;
|
||||
import net.osmand.plus.routing.RoutingHelperUtils;
|
||||
import net.osmand.plus.settings.backend.OsmandSettings;
|
||||
import net.osmand.plus.views.AnimateDraggingMapThread;
|
||||
import net.osmand.plus.views.OsmandMapTileView;
|
||||
|
@ -175,7 +176,7 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc
|
|||
locationProvider = location.getProvider();
|
||||
if (settings.DRIVING_REGION_AUTOMATIC.get() && !drivingRegionUpdated && !app.isApplicationInitializing()) {
|
||||
drivingRegionUpdated = true;
|
||||
app.getRoutingHelper().checkAndUpdateStartLocation(location);
|
||||
RoutingHelperUtils.checkAndUpdateStartLocation(app, location);
|
||||
}
|
||||
}
|
||||
if (mapView != null) {
|
||||
|
|
|
@ -32,8 +32,8 @@ import net.osmand.plus.R;
|
|||
import net.osmand.plus.UiUtilities;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.mapcontextmenu.MapContextMenu;
|
||||
import net.osmand.plus.routing.RoutingHelper;
|
||||
import net.osmand.plus.routing.RoutingHelper.RouteSegmentSearchResult;
|
||||
import net.osmand.plus.routing.RouteSegmentSearchResult;
|
||||
import net.osmand.plus.routing.RoutingHelperUtils;
|
||||
import net.osmand.plus.settings.backend.ApplicationMode;
|
||||
import net.osmand.plus.views.layers.ContextMenuLayer;
|
||||
import net.osmand.router.RouteSegmentResult;
|
||||
|
@ -150,7 +150,7 @@ public class AvoidSpecificRoads {
|
|||
if (obj != null) {
|
||||
String locale = app.getSettings().MAP_PREFERRED_LOCALE.get();
|
||||
boolean transliterate = app.getSettings().MAP_TRANSLITERATE_NAMES.get();
|
||||
String name = RoutingHelper.formatStreetName(
|
||||
String name = RoutingHelperUtils.formatStreetName(
|
||||
obj.getName(locale, transliterate),
|
||||
obj.getRef(locale, transliterate, true),
|
||||
obj.getDestinationName(locale, transliterate, true),
|
||||
|
@ -164,10 +164,7 @@ public class AvoidSpecificRoads {
|
|||
}
|
||||
|
||||
private void recalculateRoute() {
|
||||
RoutingHelper rh = app.getRoutingHelper();
|
||||
if (rh.isRouteCalculated() || rh.isRouteBeingCalculated()) {
|
||||
rh.recalculateRouteDueToSettingsChange();
|
||||
}
|
||||
app.getRoutingHelper().onSettingsChanged();
|
||||
}
|
||||
|
||||
public void removeImpassableRoad(LatLon latLon) {
|
||||
|
@ -244,7 +241,7 @@ public class AvoidSpecificRoads {
|
|||
RotatedTileBox tb = mapActivity.getMapView().getCurrentRotatedTileBox().copy();
|
||||
float maxDistPx = MAX_AVOID_ROUTE_SEARCH_RADIUS_DP * tb.getDensity();
|
||||
RouteSegmentSearchResult searchResult =
|
||||
RoutingHelper.searchRouteSegment(loc.getLatitude(), loc.getLongitude(), maxDistPx / tb.getPixDensity(), roads);
|
||||
RouteSegmentSearchResult.searchRouteSegment(loc.getLatitude(), loc.getLongitude(), maxDistPx / tb.getPixDensity(), roads);
|
||||
if (searchResult != null) {
|
||||
QuadPoint point = searchResult.getPoint();
|
||||
LatLon newLoc = new LatLon(MapUtils.get31LatitudeY((int) point.y), MapUtils.get31LongitudeX((int) point.x));
|
||||
|
|
|
@ -47,6 +47,7 @@ import net.osmand.plus.quickaction.QuickActionRegistry;
|
|||
import net.osmand.plus.routing.RouteCalculationResult.NextDirectionInfo;
|
||||
import net.osmand.plus.routing.RouteDirectionInfo;
|
||||
import net.osmand.plus.routing.RoutingHelper;
|
||||
import net.osmand.plus.routing.RoutingHelperUtils;
|
||||
import net.osmand.plus.search.listitems.QuickSearchListItem;
|
||||
import net.osmand.plus.settings.backend.ApplicationMode;
|
||||
import net.osmand.plus.track.SaveGpxAsyncTask;
|
||||
|
@ -697,7 +698,7 @@ public class ExternalApiHelper {
|
|||
if (ni.directionInfo != null && ni.directionInfo.getTurnType() != null) {
|
||||
TurnType tt = ni.directionInfo.getTurnType();
|
||||
RouteDirectionInfo a = ni.directionInfo;
|
||||
result.putExtra(prefix + PARAM_NT_DIRECTION_NAME, RoutingHelper.formatStreetName(a.getStreetName(), a.getRef(), a.getDestinationName(), ""));
|
||||
result.putExtra(prefix + PARAM_NT_DIRECTION_NAME, RoutingHelperUtils.formatStreetName(a.getStreetName(), a.getRef(), a.getDestinationName(), ""));
|
||||
result.putExtra(prefix + PARAM_NT_DIRECTION_TURN, tt.toXmlString());
|
||||
result.putExtra(prefix + PARAM_NT_DIRECTION_ANGLE, tt.getTurnAngle());
|
||||
result.putExtra(prefix + PARAM_NT_DIRECTION_POSSIBLY_LEFT, tt.isPossibleLeftTurn());
|
||||
|
|
|
@ -31,10 +31,7 @@ public class ImpassibleRoadsMenuController extends MenuController {
|
|||
if (activity != null) {
|
||||
app.getAvoidSpecificRoads().removeImpassableRoad(
|
||||
ImpassibleRoadsMenuController.this.avoidRoadInfo);
|
||||
RoutingHelper rh = app.getRoutingHelper();
|
||||
if (rh.isRouteCalculated() || rh.isRouteBeingCalculated()) {
|
||||
rh.recalculateRouteDueToSettingsChange();
|
||||
}
|
||||
app.getRoutingHelper().onSettingsChanged();
|
||||
activity.getContextMenu().close();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -137,7 +137,7 @@ public class RoutePreferencesMenu {
|
|||
LocalRoutingParameter rp = group.getRoutingParameters().get(i);
|
||||
rp.setSelected(settings, i == position);
|
||||
}
|
||||
mapActivity.getRoutingHelper().recalculateRouteDueToSettingsChange();
|
||||
mapActivity.getRoutingHelper().onSettingsChanged(true);
|
||||
updateParameters();
|
||||
}
|
||||
}
|
||||
|
@ -366,7 +366,7 @@ public class RoutePreferencesMenu {
|
|||
app.getTargetPointsHelper().updateRouteAndRefresh(true);
|
||||
updateSpinnerItems(gpxSpinner);
|
||||
updateParameters();
|
||||
mapActivity.getRoutingHelper().recalculateRouteDueToSettingsChange();
|
||||
mapActivity.getRoutingHelper().onSettingsChanged(true);
|
||||
return true;
|
||||
}
|
||||
}, app.getDaynightHelper().isNightModeForMapControls());
|
||||
|
@ -389,7 +389,7 @@ public class RoutePreferencesMenu {
|
|||
if (mapActivity.getRoutingHelper().getCurrentGPXRoute() != null) {
|
||||
mapActivity.getRoutingHelper().setGpxParams(null);
|
||||
settings.FOLLOW_THE_GPX_ROUTE.set(null);
|
||||
mapActivity.getRoutingHelper().recalculateRouteDueToSettingsChange();
|
||||
mapActivity.getRoutingHelper().onSettingsChanged(true);
|
||||
}
|
||||
updateParameters();
|
||||
return true;
|
||||
|
|
|
@ -4,6 +4,7 @@ import android.util.Pair;
|
|||
|
||||
import net.osmand.Location;
|
||||
import net.osmand.data.LatLon;
|
||||
import net.osmand.plus.routing.RouteCalculationProgressCallback;
|
||||
import net.osmand.plus.settings.backend.ApplicationMode;
|
||||
import net.osmand.GPXUtilities.TrkSegment;
|
||||
import net.osmand.GPXUtilities.WptPt;
|
||||
|
@ -127,7 +128,7 @@ public class MarkersPlanRouteContext {
|
|||
findPairsToCalculate(points);
|
||||
RoutingHelper routingHelper = app.getRoutingHelper();
|
||||
if (!snapToRoadPairsToCalculate.isEmpty() && !routingHelper.isRouteBeingCalculated()) {
|
||||
routingHelper.startRouteCalculationThread(getParams(), true, true);
|
||||
routingHelper.startRouteCalculationThread(getParams());
|
||||
app.runInUIThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
@ -217,7 +218,7 @@ public class MarkersPlanRouteContext {
|
|||
params.mode = snappedMode;
|
||||
params.ctx = app;
|
||||
params.calculationProgress = calculationProgress = new RouteCalculationProgress();
|
||||
params.calculationProgressCallback = new RoutingHelper.RouteCalculationProgressCallback() {
|
||||
params.calculationProgressCallback = new RouteCalculationProgressCallback() {
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
|
@ -265,7 +266,7 @@ public class MarkersPlanRouteContext {
|
|||
}
|
||||
});
|
||||
if (!snapToRoadPairsToCalculate.isEmpty()) {
|
||||
app.getRoutingHelper().startRouteCalculationThread(getParams(), true, true);
|
||||
app.getRoutingHelper().startRouteCalculationThread(getParams());
|
||||
} else {
|
||||
app.runInUIThread(new Runnable() {
|
||||
@Override
|
||||
|
|
|
@ -20,7 +20,7 @@ import net.osmand.plus.routing.RouteCalculationParams;
|
|||
import net.osmand.plus.routing.RouteCalculationParams.RouteCalculationResultListener;
|
||||
import net.osmand.plus.routing.RouteCalculationResult;
|
||||
import net.osmand.plus.routing.RoutingHelper;
|
||||
import net.osmand.plus.routing.RoutingHelper.RouteCalculationProgressCallback;
|
||||
import net.osmand.plus.routing.RouteCalculationProgressCallback;
|
||||
import net.osmand.plus.settings.backend.ApplicationMode;
|
||||
import net.osmand.router.RouteCalculationProgress;
|
||||
import net.osmand.router.RouteExporter;
|
||||
|
@ -673,7 +673,7 @@ public class MeasurementEditingContext {
|
|||
if (progressListener != null && !routingHelper.isRouteBeingCalculated()) {
|
||||
RouteCalculationParams params = getParams(true);
|
||||
if (params != null) {
|
||||
routingHelper.startRouteCalculationThread(params, true, true);
|
||||
routingHelper.startRouteCalculationThread(params);
|
||||
application.runInUIThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
@ -1063,7 +1063,7 @@ public class MeasurementEditingContext {
|
|||
progressListener.refresh();
|
||||
RouteCalculationParams params = getParams(false);
|
||||
if (params != null) {
|
||||
application.getRoutingHelper().startRouteCalculationThread(params, true, true);
|
||||
application.getRoutingHelper().startRouteCalculationThread(params);
|
||||
} else {
|
||||
progressListener.hideProgressBar();
|
||||
}
|
||||
|
|
|
@ -930,7 +930,7 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route
|
|||
if (isFollowTrackMode()) {
|
||||
mapActivity.getMapActions().setGPXRouteParams(gpx);
|
||||
app.getTargetPointsHelper().updateRouteAndRefresh(true);
|
||||
app.getRoutingHelper().recalculateRouteDueToSettingsChange();
|
||||
app.getRoutingHelper().onSettingsChanged(true);
|
||||
} else {
|
||||
mapActivity.getMapActions().stopNavigationActionConfirm(null , new Runnable() {
|
||||
@Override
|
||||
|
|
|
@ -301,7 +301,7 @@ public class AvoidRoadsBottomSheetDialogFragment extends MenuBottomSheetDialogFr
|
|||
avoidSpecificRoads.removeImpassableRoad(routeLocation);
|
||||
}
|
||||
|
||||
app.getRoutingHelper().recalculateRouteDueToSettingsChange();
|
||||
app.getRoutingHelper().onSettingsChanged(true);
|
||||
MapActivity mapActivity = getMapActivity();
|
||||
if (mapActivity != null) {
|
||||
final MapRouteInfoMenu mapRouteInfoMenu = mapActivity.getMapRouteInfoMenu();
|
||||
|
|
|
@ -521,7 +521,7 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca
|
|||
}
|
||||
mapActivity.getMapActions().setGPXRouteParams(gpxFile);
|
||||
app.getTargetPointsHelper().updateRouteAndRefresh(true);
|
||||
app.getRoutingHelper().recalculateRouteDueToSettingsChange();
|
||||
app.getRoutingHelper().onSettingsChanged(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -54,6 +54,7 @@ import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile;
|
|||
import net.osmand.plus.mapmarkers.MapMarker;
|
||||
import net.osmand.plus.OsmAndLocationProvider;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.routing.RoutingHelperUtils;
|
||||
import net.osmand.plus.settings.backend.OsmandSettings;
|
||||
import net.osmand.plus.settings.backend.CommonPreference;
|
||||
import net.osmand.plus.settings.backend.OsmandPreference;
|
||||
|
@ -862,7 +863,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
|
|||
}
|
||||
routingHelper.setAppMode(next);
|
||||
app.initVoiceCommandPlayer(mapActivity, next, true, null, false, false, true);
|
||||
routingHelper.recalculateRouteDueToSettingsChange();
|
||||
routingHelper.onSettingsChanged(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1279,7 +1280,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
|
|||
if (mapActivity != null) {
|
||||
OsmandApplication app = mapActivity.getMyApplication();
|
||||
app.getAvoidSpecificRoads().removeImpassableRoad(avoidRoadInfo);
|
||||
app.getRoutingHelper().recalculateRouteDueToSettingsChange();
|
||||
app.getRoutingHelper().onSettingsChanged(true);
|
||||
if (app.getAvoidSpecificRoads().getImpassableRoads().isEmpty() && getAvoidedParameters(app).isEmpty()) {
|
||||
mode.parameters.remove(parameter);
|
||||
}
|
||||
|
@ -1312,7 +1313,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
|
|||
CommonPreference<Boolean> preference = settings.getCustomRoutingBooleanProperty(routingParameter.getId(), routingParameter.getDefaultBoolean());
|
||||
preference.setModeValue(app.getRoutingHelper().getAppMode(), false);
|
||||
avoidedParameters.remove(routingParameter);
|
||||
app.getRoutingHelper().recalculateRouteDueToSettingsChange();
|
||||
app.getRoutingHelper().onSettingsChanged(true);
|
||||
if (app.getAvoidSpecificRoads().getImpassableRoads().isEmpty() && avoidedParameters.isEmpty()) {
|
||||
mode.parameters.remove(parameter);
|
||||
}
|
||||
|
@ -2411,7 +2412,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
|
|||
}
|
||||
} else if (routingHelper.isRouteCalculated()) {
|
||||
RouteCalculationResult result = routingHelper.getRoute();
|
||||
QuadRect routeRect = routingHelper.getRouteRect(result);
|
||||
QuadRect routeRect = RoutingHelperUtils.getRouteRect(app, result);
|
||||
if (routeRect != null) {
|
||||
rect = routeRect;
|
||||
}
|
||||
|
|
|
@ -400,7 +400,7 @@ public class RouteOptionsBottomSheet extends MenuBottomSheetDialogFragment {
|
|||
boolean enabled = !settings.ENABLE_TIME_CONDITIONAL_ROUTING.getModeValue(applicationMode);
|
||||
settings.ENABLE_TIME_CONDITIONAL_ROUTING.setModeValue(applicationMode, enabled);
|
||||
timeConditionalRoutingItem[0].setChecked(enabled);
|
||||
app.getRoutingHelper().recalculateRouteDueToSettingsChange();
|
||||
app.getRoutingHelper().onSettingsChanged(true);
|
||||
}
|
||||
})
|
||||
.create();
|
||||
|
|
|
@ -230,7 +230,7 @@ public class RoutingOptionsHelper {
|
|||
if (rp instanceof OtherLocalRoutingParameter) {
|
||||
updateGpxRoutingParameter((OtherLocalRoutingParameter) rp);
|
||||
}
|
||||
routingHelper.recalculateRouteDueToSettingsChange();
|
||||
routingHelper.onSettingsChanged(true);
|
||||
}
|
||||
|
||||
public void updateGpxRoutingParameter(OtherLocalRoutingParameter gpxParam) {
|
||||
|
@ -377,7 +377,7 @@ public class RoutingOptionsHelper {
|
|||
LocalRoutingParameter rp = group.getRoutingParameters().get(i);
|
||||
rp.setSelected(settings, i == position);
|
||||
}
|
||||
mapActivity.getRoutingHelper().recalculateRouteDueToSettingsChange();
|
||||
mapActivity.getRoutingHelper().onSettingsChanged(true);
|
||||
if (listener != null) {
|
||||
listener.onClick();
|
||||
}
|
||||
|
|
|
@ -108,7 +108,7 @@ public class MapMarkersCard extends BaseCard {
|
|||
public void onClick(View v) {
|
||||
LatLon point = new LatLon(marker.getLatitude(), marker.getLongitude());
|
||||
app.getTargetPointsHelper().navigateToPoint(point, true, -1, marker.getPointDescription(mapActivity));
|
||||
app.getRoutingHelper().recalculateRouteDueToSettingsChange();
|
||||
app.getRoutingHelper().onSettingsChanged(true);
|
||||
}
|
||||
});
|
||||
if (i > 0) {
|
||||
|
|
87
OsmAnd/src/net/osmand/plus/routing/CurrentStreetName.java
Normal file
87
OsmAnd/src/net/osmand/plus/routing/CurrentStreetName.java
Normal file
|
@ -0,0 +1,87 @@
|
|||
package net.osmand.plus.routing;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import net.osmand.Location;
|
||||
import net.osmand.binary.RouteDataObject;
|
||||
import net.osmand.plus.routing.RouteCalculationResult.NextDirectionInfo;
|
||||
import net.osmand.plus.settings.backend.OsmandSettings;
|
||||
import net.osmand.router.RouteSegmentResult;
|
||||
import net.osmand.router.TurnType;
|
||||
import net.osmand.util.Algorithms;
|
||||
|
||||
public class CurrentStreetName {
|
||||
public String text;
|
||||
public TurnType turnType;
|
||||
public boolean showMarker; // turn type has priority over showMarker
|
||||
public RouteDataObject shieldObject;
|
||||
public String exitRef;
|
||||
|
||||
@NonNull
|
||||
private static String getRouteSegmentStreetName(@NonNull RoutingHelper routingHelper, @NonNull RouteSegmentResult rs, boolean includeRef) {
|
||||
OsmandSettings settings = routingHelper.getSettings();
|
||||
String nm = rs.getObject().getName(settings.MAP_PREFERRED_LOCALE.get(), settings.MAP_TRANSLITERATE_NAMES.get());
|
||||
String rf = rs.getObject().getRef(settings.MAP_PREFERRED_LOCALE.get(), settings.MAP_TRANSLITERATE_NAMES.get(), rs.isForwardDirection());
|
||||
String dn = rs.getObject().getDestinationName(settings.MAP_PREFERRED_LOCALE.get(),
|
||||
settings.MAP_TRANSLITERATE_NAMES.get(), rs.isForwardDirection());
|
||||
return RoutingHelperUtils.formatStreetName(nm, includeRef ? rf : null, dn, "»");
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static CurrentStreetName getCurrentName(@NonNull RoutingHelper routingHelper, @NonNull NextDirectionInfo n) {
|
||||
CurrentStreetName streetName = new CurrentStreetName();
|
||||
Location l = routingHelper.getLastFixedLocation();
|
||||
float speed = 0;
|
||||
if (l != null && l.hasSpeed()) {
|
||||
speed = l.getSpeed();
|
||||
}
|
||||
boolean isSet = false;
|
||||
// 1. turn is imminent
|
||||
if (n.distanceTo > 0 && n.directionInfo != null && !n.directionInfo.getTurnType().isSkipToSpeak() &&
|
||||
routingHelper.getVoiceRouter().isDistanceLess(speed, n.distanceTo, routingHelper.getVoiceRouter().PREPARE_DISTANCE * 0.75f)) {
|
||||
String nm = n.directionInfo.getStreetName();
|
||||
String rf = n.directionInfo.getRef();
|
||||
String dn = n.directionInfo.getDestinationName();
|
||||
isSet = !(Algorithms.isEmpty(nm) && Algorithms.isEmpty(rf) && Algorithms.isEmpty(dn));
|
||||
streetName.text = RoutingHelperUtils.formatStreetName(nm, null, dn, "»");
|
||||
streetName.turnType = n.directionInfo.getTurnType();
|
||||
streetName.shieldObject = n.directionInfo.getRouteDataObject();
|
||||
if (streetName.turnType == null) {
|
||||
streetName.turnType = TurnType.valueOf(TurnType.C, false);
|
||||
}
|
||||
if (n.directionInfo.getExitInfo() != null) {
|
||||
streetName.exitRef = n.directionInfo.getExitInfo().getRef();
|
||||
if (!Algorithms.isEmpty(n.directionInfo.getExitInfo().getExitStreetName())) {
|
||||
streetName.text = n.directionInfo.getExitInfo().getExitStreetName();
|
||||
}
|
||||
}
|
||||
}
|
||||
// 2. display current road street name
|
||||
if (!isSet) {
|
||||
RouteSegmentResult rs = routingHelper.getCurrentSegmentResult();
|
||||
if (rs != null) {
|
||||
streetName.text = getRouteSegmentStreetName(routingHelper, rs, false);
|
||||
if (Algorithms.isEmpty(streetName.text)) {
|
||||
isSet = !Algorithms.isEmpty(getRouteSegmentStreetName(routingHelper, rs, true));
|
||||
} else {
|
||||
isSet = true;
|
||||
}
|
||||
streetName.showMarker = true;
|
||||
streetName.shieldObject = rs.getObject();
|
||||
}
|
||||
}
|
||||
// 3. display next road street name if this one empty
|
||||
if (!isSet) {
|
||||
RouteSegmentResult rs = routingHelper.getNextStreetSegmentResult();
|
||||
if (rs != null) {
|
||||
streetName.text = getRouteSegmentStreetName(routingHelper, rs, false);
|
||||
streetName.turnType = TurnType.valueOf(TurnType.C, false);
|
||||
streetName.shieldObject = rs.getObject();
|
||||
}
|
||||
}
|
||||
if (streetName.turnType == null) {
|
||||
streetName.showMarker = true;
|
||||
}
|
||||
return streetName;
|
||||
}
|
||||
}
|
|
@ -5,7 +5,6 @@ import net.osmand.data.LatLon;
|
|||
import net.osmand.plus.settings.backend.ApplicationMode;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.routing.RouteProvider.GPXRouteParams;
|
||||
import net.osmand.plus.routing.RoutingHelper.RouteCalculationProgressCallback;
|
||||
import net.osmand.router.RouteCalculationProgress;
|
||||
|
||||
import java.util.List;
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
package net.osmand.plus.routing;
|
||||
|
||||
public interface RouteCalculationProgressCallback {
|
||||
|
||||
void start();
|
||||
|
||||
void updateProgress(int progress);
|
||||
|
||||
void requestPrivateAccessRouting();
|
||||
|
||||
void finish();
|
||||
}
|
|
@ -435,7 +435,7 @@ public class RouteCalculationResult {
|
|||
}
|
||||
}
|
||||
|
||||
String description = toString(turn, ctx, false) + " " + RoutingHelper.formatStreetName(info.getStreetName(),
|
||||
String description = toString(turn, ctx, false) + " " + RoutingHelperUtils.formatStreetName(info.getStreetName(),
|
||||
info.getRef(), info.getDestinationName(), ctx.getString(R.string.towards));
|
||||
description = description.trim();
|
||||
String[] pointNames = s.getObject().getPointNames(s.getStartPointIndex());
|
||||
|
|
|
@ -0,0 +1,389 @@
|
|||
package net.osmand.plus.routing;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import net.osmand.Location;
|
||||
import net.osmand.data.LatLon;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.settings.backend.ApplicationMode;
|
||||
import net.osmand.plus.settings.backend.OsmandSettings;
|
||||
import net.osmand.router.RouteCalculationProgress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static net.osmand.plus.notifications.OsmandNotification.NotificationType.NAVIGATION;
|
||||
|
||||
class RouteRecalculationThreadHelper {
|
||||
|
||||
private static final int RECALCULATE_THRESHOLD_COUNT_CAUSING_FULL_RECALCULATE = 3;
|
||||
private static final int RECALCULATE_THRESHOLD_CAUSING_FULL_RECALCULATE_INTERVAL = 2 * 60 * 1000;
|
||||
|
||||
private final OsmandApplication app;
|
||||
private final RoutingHelper routingHelper;
|
||||
|
||||
private Thread currentRunningJob;
|
||||
private long lastTimeEvaluatedRoute = 0;
|
||||
private String lastRouteCalcError;
|
||||
private String lastRouteCalcErrorShort;
|
||||
private long recalculateCountInInterval = 0;
|
||||
private int evalWaitInterval = 0;
|
||||
private boolean waitingNextJob;
|
||||
|
||||
private RouteCalculationProgressCallback progressRoute;
|
||||
|
||||
RouteRecalculationThreadHelper(@NonNull RoutingHelper routingHelper) {
|
||||
this.routingHelper = routingHelper;
|
||||
this.app = routingHelper.getApplication();
|
||||
}
|
||||
|
||||
String getLastRouteCalcError() {
|
||||
return lastRouteCalcError;
|
||||
}
|
||||
|
||||
String getLastRouteCalcErrorShort() {
|
||||
return lastRouteCalcErrorShort;
|
||||
}
|
||||
|
||||
void setProgressBar(RouteCalculationProgressCallback progressRoute) {
|
||||
this.progressRoute = progressRoute;
|
||||
}
|
||||
|
||||
boolean isRouteBeingCalculated() {
|
||||
return currentRunningJob instanceof RouteRecalculationThread || waitingNextJob;
|
||||
}
|
||||
|
||||
void resetEvalWaitInterval() {
|
||||
evalWaitInterval = 0;
|
||||
}
|
||||
|
||||
void stopCalculation() {
|
||||
Thread job = currentRunningJob;
|
||||
if (job instanceof RouteRecalculationThread) {
|
||||
((RouteRecalculationThread) job).stopCalculation();
|
||||
}
|
||||
}
|
||||
|
||||
void stopCalculationIfParamsChanged() {
|
||||
Thread job = currentRunningJob;
|
||||
if (job instanceof RouteRecalculationThread) {
|
||||
RouteRecalculationThread thread = (RouteRecalculationThread) job;
|
||||
if (!thread.isParamsChanged()) {
|
||||
thread.stopCalculation();
|
||||
}
|
||||
if (isFollowingMode()) {
|
||||
getVoiceRouter().announceBackOnRoute();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private OsmandSettings getSettings() {
|
||||
return routingHelper.getSettings();
|
||||
}
|
||||
|
||||
private ApplicationMode getAppMode() {
|
||||
return routingHelper.getAppMode();
|
||||
}
|
||||
|
||||
private boolean isFollowingMode() {
|
||||
return routingHelper.isFollowingMode();
|
||||
}
|
||||
|
||||
private VoiceRouter getVoiceRouter() {
|
||||
return routingHelper.getVoiceRouter();
|
||||
}
|
||||
|
||||
private Location getLastFixedLocation() {
|
||||
return routingHelper.getLastFixedLocation();
|
||||
}
|
||||
|
||||
private boolean isDeviatedFromRoute() {
|
||||
return routingHelper.isDeviatedFromRoute();
|
||||
}
|
||||
|
||||
private Location getLastProjection() {
|
||||
return routingHelper.getLastProjection();
|
||||
}
|
||||
|
||||
private void setNewRoute(RouteCalculationResult prevRoute, final RouteCalculationResult res, Location start) {
|
||||
final boolean newRoute = !prevRoute.isCalculated();
|
||||
if (isFollowingMode()) {
|
||||
Location lastFixedLocation = getLastFixedLocation();
|
||||
if (lastFixedLocation != null) {
|
||||
start = lastFixedLocation;
|
||||
}
|
||||
// try remove false route-recalculated prompts by checking direction to second route node
|
||||
boolean wrongMovementDirection = false;
|
||||
List<Location> routeNodes = res.getImmutableAllLocations();
|
||||
if (routeNodes != null && !routeNodes.isEmpty()) {
|
||||
int newCurrentRoute = RoutingHelperUtils.lookAheadFindMinOrthogonalDistance(start, routeNodes, res.currentRoute, 15);
|
||||
if (newCurrentRoute + 1 < routeNodes.size()) {
|
||||
// This check is valid for Online/GPX services (offline routing is aware of route direction)
|
||||
wrongMovementDirection = RoutingHelperUtils.checkWrongMovementDirection(start, routeNodes.get(newCurrentRoute + 1));
|
||||
// set/reset evalWaitInterval only if new route is in forward direction
|
||||
if (wrongMovementDirection) {
|
||||
evalWaitInterval = 3000;
|
||||
} else {
|
||||
evalWaitInterval = Math.max(3000, evalWaitInterval * 3 / 2);
|
||||
evalWaitInterval = Math.min(evalWaitInterval, 120000);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// trigger voice prompt only if new route is in forward direction
|
||||
// If route is in wrong direction after one more setLocation it will be recalculated
|
||||
if (!wrongMovementDirection || newRoute) {
|
||||
getVoiceRouter().newRouteIsCalculated(newRoute);
|
||||
}
|
||||
}
|
||||
app.getWaypointHelper().setNewRoute(res);
|
||||
routingHelper.newRouteCalculated(newRoute, res);
|
||||
}
|
||||
|
||||
void startRouteCalculationThread(RouteCalculationParams params, boolean paramsChanged, boolean updateProgress) {
|
||||
synchronized (routingHelper) {
|
||||
final Thread prevRunningJob = currentRunningJob;
|
||||
getSettings().LAST_ROUTE_APPLICATION_MODE.set(getAppMode());
|
||||
RouteRecalculationThread newThread = new RouteRecalculationThread("Calculating route", params, paramsChanged);
|
||||
currentRunningJob = newThread;
|
||||
startProgress(params);
|
||||
if (updateProgress) {
|
||||
updateProgress(params);
|
||||
}
|
||||
if (prevRunningJob != null) {
|
||||
newThread.setWaitPrevJob(prevRunningJob);
|
||||
}
|
||||
currentRunningJob.start();
|
||||
}
|
||||
}
|
||||
|
||||
public void recalculateRouteInBackground(final Location start, final LatLon end, final List<LatLon> intermediates,
|
||||
final RouteProvider.GPXRouteParamsBuilder gpxRoute, final RouteCalculationResult previousRoute, boolean paramsChanged, boolean onlyStartPointChanged) {
|
||||
if (start == null || end == null) {
|
||||
return;
|
||||
}
|
||||
// do not evaluate very often
|
||||
if ((currentRunningJob == null && System.currentTimeMillis() - lastTimeEvaluatedRoute > evalWaitInterval)
|
||||
|| paramsChanged || !onlyStartPointChanged) {
|
||||
if (System.currentTimeMillis() - lastTimeEvaluatedRoute < RECALCULATE_THRESHOLD_CAUSING_FULL_RECALCULATE_INTERVAL) {
|
||||
recalculateCountInInterval++;
|
||||
}
|
||||
ApplicationMode mode = getAppMode();
|
||||
final RouteCalculationParams params = new RouteCalculationParams();
|
||||
params.start = start;
|
||||
params.end = end;
|
||||
params.intermediates = intermediates;
|
||||
params.gpxRoute = gpxRoute == null ? null : gpxRoute.build(app);
|
||||
params.onlyStartPointChanged = onlyStartPointChanged;
|
||||
if (recalculateCountInInterval < RECALCULATE_THRESHOLD_COUNT_CAUSING_FULL_RECALCULATE
|
||||
|| (gpxRoute != null && gpxRoute.isPassWholeRoute() && isDeviatedFromRoute())) {
|
||||
params.previousToRecalculate = previousRoute;
|
||||
} else {
|
||||
recalculateCountInInterval = 0;
|
||||
}
|
||||
params.leftSide = getSettings().DRIVING_REGION.get().leftHandDriving;
|
||||
params.fast = getSettings().FAST_ROUTE_MODE.getModeValue(mode);
|
||||
params.mode = mode;
|
||||
params.ctx = app;
|
||||
boolean updateProgress = false;
|
||||
if (params.mode.getRouteService() == RouteProvider.RouteService.OSMAND) {
|
||||
params.calculationProgress = new RouteCalculationProgress();
|
||||
updateProgress = true;
|
||||
} else {
|
||||
params.resultListener = new RouteCalculationParams.RouteCalculationResultListener() {
|
||||
@Override
|
||||
public void onRouteCalculated(RouteCalculationResult route) {
|
||||
app.runInUIThread(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
finishProgress(params);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
if (getLastProjection() != null) {
|
||||
params.currentLocation = getLastFixedLocation();
|
||||
}
|
||||
startRouteCalculationThread(params, paramsChanged, updateProgress);
|
||||
}
|
||||
}
|
||||
|
||||
void startProgress(final RouteCalculationParams params) {
|
||||
if (params.calculationProgressCallback != null) {
|
||||
params.calculationProgressCallback.start();
|
||||
} else if (progressRoute != null) {
|
||||
progressRoute.start();
|
||||
}
|
||||
}
|
||||
|
||||
void updateProgress(final RouteCalculationParams params) {
|
||||
final RouteCalculationProgressCallback progressRoute;
|
||||
if (params.calculationProgressCallback != null) {
|
||||
progressRoute = params.calculationProgressCallback;
|
||||
} else {
|
||||
progressRoute = this.progressRoute;
|
||||
}
|
||||
if (progressRoute != null) {
|
||||
app.runInUIThread(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
RouteCalculationProgress calculationProgress = params.calculationProgress;
|
||||
if (isRouteBeingCalculated()) {
|
||||
Thread t = currentRunningJob;
|
||||
if (t instanceof RouteRecalculationThread && ((RouteRecalculationThread) t).params != params) {
|
||||
// different calculation started
|
||||
return;
|
||||
} else {
|
||||
progressRoute.updateProgress((int) calculationProgress.getLinearProgress());
|
||||
if (calculationProgress.requestPrivateAccessRouting) {
|
||||
progressRoute.requestPrivateAccessRouting();
|
||||
}
|
||||
updateProgress(params);
|
||||
}
|
||||
} else {
|
||||
if (calculationProgress.requestPrivateAccessRouting) {
|
||||
progressRoute.requestPrivateAccessRouting();
|
||||
}
|
||||
progressRoute.finish();
|
||||
}
|
||||
}
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
void finishProgress(RouteCalculationParams params) {
|
||||
final RouteCalculationProgressCallback progressRoute;
|
||||
if (params.calculationProgressCallback != null) {
|
||||
progressRoute = params.calculationProgressCallback;
|
||||
} else {
|
||||
progressRoute = this.progressRoute;
|
||||
}
|
||||
if (progressRoute != null) {
|
||||
progressRoute.finish();
|
||||
}
|
||||
}
|
||||
|
||||
private void showMessage(final String msg) {
|
||||
app.runInUIThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
app.showToastMessage(msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
class RouteRecalculationThread extends Thread {
|
||||
|
||||
private final RouteCalculationParams params;
|
||||
private final boolean paramsChanged;
|
||||
private Thread prevRunningJob;
|
||||
|
||||
public RouteRecalculationThread(String name, RouteCalculationParams params, boolean paramsChanged) {
|
||||
super(name);
|
||||
this.params = params;
|
||||
this.paramsChanged = paramsChanged;
|
||||
if (params.calculationProgress == null) {
|
||||
params.calculationProgress = new RouteCalculationProgress();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isParamsChanged() {
|
||||
return paramsChanged;
|
||||
}
|
||||
|
||||
public void stopCalculation() {
|
||||
params.calculationProgress.isCancelled = true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
synchronized (routingHelper) {
|
||||
routingHelper.resetRouteWasFinished();
|
||||
currentRunningJob = this;
|
||||
waitingNextJob = prevRunningJob != null;
|
||||
}
|
||||
if (prevRunningJob != null) {
|
||||
while (prevRunningJob.isAlive()) {
|
||||
try {
|
||||
Thread.sleep(50);
|
||||
} catch (InterruptedException e) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
synchronized (routingHelper) {
|
||||
if (params.calculationProgress.isCancelled) {
|
||||
return;
|
||||
}
|
||||
currentRunningJob = this;
|
||||
waitingNextJob = false;
|
||||
}
|
||||
}
|
||||
lastRouteCalcError = null;
|
||||
lastRouteCalcErrorShort = null;
|
||||
RouteProvider provider = routingHelper.getProvider();
|
||||
OsmandSettings settings = getSettings();
|
||||
RouteCalculationResult res = provider.calculateRouteImpl(params);
|
||||
if (params.calculationProgress.isCancelled) {
|
||||
synchronized (routingHelper) {
|
||||
currentRunningJob = null;
|
||||
}
|
||||
return;
|
||||
}
|
||||
final boolean onlineSourceWithoutInternet = !res.isCalculated() &&
|
||||
params.mode.getRouteService().isOnline() && !settings.isInternetConnectionAvailable();
|
||||
if (onlineSourceWithoutInternet && settings.GPX_ROUTE_CALC_OSMAND_PARTS.get()) {
|
||||
if (params.previousToRecalculate != null && params.previousToRecalculate.isCalculated()) {
|
||||
res = provider.recalculatePartOfflineRoute(res, params);
|
||||
}
|
||||
}
|
||||
RouteCalculationResult prev = routingHelper.getRoute();
|
||||
synchronized (routingHelper) {
|
||||
if (res.isCalculated()) {
|
||||
if (!params.inSnapToRoadMode && !params.inPublicTransportMode) {
|
||||
routingHelper.setRoute(res);
|
||||
routingHelper.updateOriginalRoute();
|
||||
}
|
||||
if (params.resultListener != null) {
|
||||
params.resultListener.onRouteCalculated(res);
|
||||
}
|
||||
} else {
|
||||
evalWaitInterval = Math.max(3000, evalWaitInterval * 3 / 2); // for Issue #3899
|
||||
evalWaitInterval = Math.min(evalWaitInterval, 120000);
|
||||
}
|
||||
currentRunningJob = null;
|
||||
}
|
||||
if (res.isCalculated()) {
|
||||
if (!params.inSnapToRoadMode && !params.inPublicTransportMode) {
|
||||
setNewRoute(prev, res, params.start);
|
||||
}
|
||||
} else if (onlineSourceWithoutInternet) {
|
||||
lastRouteCalcError = app.getString(R.string.error_calculating_route)
|
||||
+ ":\n" + app.getString(R.string.internet_connection_required_for_online_route);
|
||||
lastRouteCalcErrorShort = app.getString(R.string.error_calculating_route);
|
||||
showMessage(lastRouteCalcError); //$NON-NLS-1$
|
||||
} else {
|
||||
if (res.getErrorMessage() != null) {
|
||||
lastRouteCalcError = app.getString(R.string.error_calculating_route) + ":\n" + res.getErrorMessage();
|
||||
lastRouteCalcErrorShort = app.getString(R.string.error_calculating_route);
|
||||
showMessage(lastRouteCalcError); //$NON-NLS-1$
|
||||
} else {
|
||||
lastRouteCalcError = app.getString(R.string.empty_route_calculated);
|
||||
lastRouteCalcErrorShort = app.getString(R.string.empty_route_calculated);
|
||||
showMessage(lastRouteCalcError);
|
||||
}
|
||||
}
|
||||
app.getNotificationHelper().refreshNotification(NAVIGATION);
|
||||
lastTimeEvaluatedRoute = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public void setWaitPrevJob(Thread prevRunningJob) {
|
||||
this.prevRunningJob = prevRunningJob;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
package net.osmand.plus.routing;
|
||||
|
||||
import net.osmand.binary.RouteDataObject;
|
||||
import net.osmand.data.QuadPoint;
|
||||
import net.osmand.router.RouteSegmentResult;
|
||||
import net.osmand.util.MapUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RouteSegmentSearchResult {
|
||||
private final int roadIndex;
|
||||
private final int segmentIndex;
|
||||
private final QuadPoint point;
|
||||
|
||||
RouteSegmentSearchResult(int roadIndex, int segmentIndex, QuadPoint point) {
|
||||
this.roadIndex = roadIndex;
|
||||
this.segmentIndex = segmentIndex;
|
||||
this.point = point;
|
||||
}
|
||||
|
||||
public int getRoadIndex() {
|
||||
return roadIndex;
|
||||
}
|
||||
|
||||
public int getSegmentIndex() {
|
||||
return segmentIndex;
|
||||
}
|
||||
|
||||
public QuadPoint getPoint() {
|
||||
return point;
|
||||
}
|
||||
|
||||
public static RouteSegmentSearchResult searchRouteSegment(double latitude, double longitude, double maxDist, List<RouteSegmentResult> roads) {
|
||||
int roadIndex = -1;
|
||||
int segmentIndex = -1;
|
||||
QuadPoint point = null;
|
||||
int px = MapUtils.get31TileNumberX(longitude);
|
||||
int py = MapUtils.get31TileNumberY(latitude);
|
||||
double dist = maxDist < 0 ? 1000 : maxDist;
|
||||
for (int i = 0; i < roads.size(); i++) {
|
||||
RouteSegmentResult road = roads.get(i);
|
||||
int startPointIndex = Math.min(road.getStartPointIndex(), road.getEndPointIndex());
|
||||
int endPointIndex = Math.max(road.getEndPointIndex(), road.getStartPointIndex());
|
||||
RouteDataObject obj = road.getObject();
|
||||
for (int j = startPointIndex + 1; j <= endPointIndex; j++) {
|
||||
QuadPoint proj = MapUtils.getProjectionPoint31(px, py, obj.getPoint31XTile(j - 1), obj.getPoint31YTile(j - 1),
|
||||
obj.getPoint31XTile(j), obj.getPoint31YTile(j));
|
||||
double dd = MapUtils.squareRootDist31((int) proj.x, (int) proj.y, px, py);
|
||||
if (dd < dist) {
|
||||
dist = dd;
|
||||
roadIndex = i;
|
||||
segmentIndex = j;
|
||||
point = proj;
|
||||
}
|
||||
}
|
||||
}
|
||||
return roadIndex != -1 ? new RouteSegmentSearchResult(roadIndex, segmentIndex, point) : null;
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
210
OsmAnd/src/net/osmand/plus/routing/RoutingHelperUtils.java
Normal file
210
OsmAnd/src/net/osmand/plus/routing/RoutingHelperUtils.java
Normal file
|
@ -0,0 +1,210 @@
|
|||
package net.osmand.plus.routing;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import net.osmand.Location;
|
||||
import net.osmand.data.LatLon;
|
||||
import net.osmand.data.QuadRect;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.TargetPointsHelper;
|
||||
import net.osmand.plus.helpers.enums.MetricsConstants;
|
||||
import net.osmand.plus.settings.backend.ApplicationMode;
|
||||
import net.osmand.plus.settings.backend.OsmandSettings;
|
||||
import net.osmand.util.MapUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RoutingHelperUtils {
|
||||
|
||||
private static final float POSITION_TOLERANCE = 60;
|
||||
private static final int CACHE_RADIUS = 100000;
|
||||
|
||||
@NonNull
|
||||
public static String formatStreetName(String name, String ref, String destination, String towards) {
|
||||
String formattedStreetName = "";
|
||||
if (ref != null && ref.length() > 0) {
|
||||
formattedStreetName = ref;
|
||||
}
|
||||
if (name != null && name.length() > 0) {
|
||||
if (formattedStreetName.length() > 0) {
|
||||
formattedStreetName = formattedStreetName + " ";
|
||||
}
|
||||
formattedStreetName = formattedStreetName + name;
|
||||
}
|
||||
if (destination != null && destination.length() > 0) {
|
||||
if (formattedStreetName.length() > 0) {
|
||||
formattedStreetName = formattedStreetName + " ";
|
||||
}
|
||||
formattedStreetName = formattedStreetName + towards + " " + destination;
|
||||
}
|
||||
return formattedStreetName.replace(";", ", ");
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static QuadRect getRouteRect(@NonNull OsmandApplication app, @NonNull RouteCalculationResult result) {
|
||||
QuadRect rect = new QuadRect(0, 0, 0, 0);
|
||||
Location lt = app.getRoutingHelper().getLastProjection();
|
||||
if (lt == null) {
|
||||
lt = app.getTargetPointsHelper().getPointToStartLocation();
|
||||
}
|
||||
if (lt == null) {
|
||||
lt = app.getLocationProvider().getLastKnownLocation();
|
||||
}
|
||||
if (lt != null) {
|
||||
MapUtils.insetLatLonRect(rect, lt.getLatitude(), lt.getLongitude());
|
||||
}
|
||||
List<Location> list = result.getImmutableAllLocations();
|
||||
for (Location l : list) {
|
||||
MapUtils.insetLatLonRect(rect, l.getLatitude(), l.getLongitude());
|
||||
}
|
||||
List<TargetPointsHelper.TargetPoint> targetPoints = app.getTargetPointsHelper().getIntermediatePointsWithTarget();
|
||||
for (TargetPointsHelper.TargetPoint l : targetPoints) {
|
||||
MapUtils.insetLatLonRect(rect, l.getLatitude(), l.getLongitude());
|
||||
}
|
||||
|
||||
return rect.left == 0 && rect.right == 0 ? null : rect;
|
||||
}
|
||||
|
||||
static LatLon getProject(Location loc, Location from, Location to) {
|
||||
return MapUtils.getProjection(loc.getLatitude(),
|
||||
loc.getLongitude(), from.getLatitude(), from.getLongitude(),
|
||||
to.getLatitude(), to.getLongitude());
|
||||
}
|
||||
|
||||
static double getOrthogonalDistance(Location loc, Location from, Location to) {
|
||||
return MapUtils.getOrthogonalDistance(loc.getLatitude(),
|
||||
loc.getLongitude(), from.getLatitude(), from.getLongitude(),
|
||||
to.getLatitude(), to.getLongitude());
|
||||
}
|
||||
|
||||
static int lookAheadFindMinOrthogonalDistance(Location currentLocation, List<Location> routeNodes, int currentRoute, int iterations) {
|
||||
double newDist;
|
||||
double dist = Double.POSITIVE_INFINITY;
|
||||
int index = currentRoute;
|
||||
while (iterations > 0 && currentRoute + 1 < routeNodes.size()) {
|
||||
newDist = getOrthogonalDistance(currentLocation, routeNodes.get(currentRoute), routeNodes.get(currentRoute + 1));
|
||||
if (newDist < dist) {
|
||||
index = currentRoute;
|
||||
dist = newDist;
|
||||
}
|
||||
currentRoute++;
|
||||
iterations--;
|
||||
}
|
||||
return index;
|
||||
}
|
||||
|
||||
public static float getPosTolerance(float accuracy) {
|
||||
if (accuracy > 0) {
|
||||
return POSITION_TOLERANCE / 2 + accuracy;
|
||||
}
|
||||
return POSITION_TOLERANCE;
|
||||
}
|
||||
|
||||
public static float getDefaultAllowedDeviation(OsmandSettings settings, ApplicationMode mode, float posTolerance) {
|
||||
if (settings.DISABLE_OFFROUTE_RECALC.getModeValue(mode)) {
|
||||
return -1.0f;
|
||||
} else if (mode.getRouteService() == RouteProvider.RouteService.DIRECT_TO) {
|
||||
return -1.0f;
|
||||
} else if (mode.getRouteService() == RouteProvider.RouteService.STRAIGHT) {
|
||||
MetricsConstants mc = settings.METRIC_SYSTEM.getModeValue(mode);
|
||||
if (mc == MetricsConstants.KILOMETERS_AND_METERS || mc == MetricsConstants.MILES_AND_METERS) {
|
||||
return 500.f;
|
||||
} else {
|
||||
// 1/4 mile
|
||||
return 482.f;
|
||||
}
|
||||
}
|
||||
return posTolerance * RoutingHelper.ALLOWED_DEVIATION;
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrong movement direction is considered when between
|
||||
* current location bearing (determines by 2 last fixed position or provided)
|
||||
* and bearing from currentLocation to next (current) point
|
||||
* the difference is more than 60 degrees
|
||||
*/
|
||||
public static boolean checkWrongMovementDirection(Location currentLocation, Location nextRouteLocation) {
|
||||
// measuring without bearing could be really error prone (with last fixed location)
|
||||
// this code has an effect on route recalculation which should be detected without mistakes
|
||||
if (currentLocation.hasBearing() && nextRouteLocation != null) {
|
||||
float bearingMotion = currentLocation.getBearing();
|
||||
float bearingToRoute = currentLocation.bearingTo(nextRouteLocation);
|
||||
double diff = MapUtils.degreesDiff(bearingMotion, bearingToRoute);
|
||||
if (Math.abs(diff) > 60f) {
|
||||
// require delay interval since first detection, to avoid false positive
|
||||
//but leave out for now, as late detection is worse than false positive (it may reset voice router then cause bogus turn and u-turn prompting)
|
||||
//if (wrongMovementDetected == 0) {
|
||||
// wrongMovementDetected = System.currentTimeMillis();
|
||||
//} else if ((System.currentTimeMillis() - wrongMovementDetected > 500)) {
|
||||
return true;
|
||||
//}
|
||||
} else {
|
||||
//wrongMovementDetected = 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//wrongMovementDetected = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
static boolean identifyUTurnIsNeeded(@NonNull RoutingHelper routingHelper, @NonNull Location currentLocation, double posTolerance) {
|
||||
RouteCalculationResult route = routingHelper.getRoute();
|
||||
if (routingHelper.getFinalLocation() == null || currentLocation == null || !route.isCalculated() || routingHelper.isPublicTransportMode()) {
|
||||
return false;
|
||||
}
|
||||
boolean isOffRoute = false;
|
||||
if (currentLocation.hasBearing()) {
|
||||
float bearingMotion = currentLocation.getBearing();
|
||||
Location nextRoutePosition = route.getNextRouteLocation();
|
||||
float bearingToRoute = currentLocation.bearingTo(nextRoutePosition);
|
||||
double diff = MapUtils.degreesDiff(bearingMotion, bearingToRoute);
|
||||
// 7. Check if you left the route and an unscheduled U-turn would bring you back (also Issue 863)
|
||||
// This prompt is an interim advice and does only sound if a new route in forward direction could not be found in x seconds
|
||||
if (Math.abs(diff) > 135f) {
|
||||
float d = currentLocation.distanceTo(nextRoutePosition);
|
||||
// 60m tolerance to allow for GPS inaccuracy
|
||||
if (d > posTolerance) {
|
||||
// require x sec continuous since first detection
|
||||
long deviateFromRouteDetected = routingHelper.getDeviateFromRouteDetected();
|
||||
if (deviateFromRouteDetected == 0) {
|
||||
routingHelper.setDeviateFromRouteDetected(System.currentTimeMillis());
|
||||
} else if ((System.currentTimeMillis() - deviateFromRouteDetected > 10000)) {
|
||||
isOffRoute = true;
|
||||
//log.info("bearingMotion is opposite to bearingRoute"); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
} else {
|
||||
routingHelper.setDeviateFromRouteDetected(0);
|
||||
}
|
||||
}
|
||||
return isOffRoute;
|
||||
}
|
||||
|
||||
static float getArrivalDistance(ApplicationMode mode, OsmandSettings settings) {
|
||||
ApplicationMode m = mode == null ? settings.getApplicationMode() : mode;
|
||||
float defaultSpeed = Math.max(0.3f, m.getDefaultSpeed());
|
||||
|
||||
/// Used to be: car - 90 m, bicycle - 50 m, pedestrian - 20 m
|
||||
// return ((float)settings.getApplicationMode().getArrivalDistance()) * settings.ARRIVAL_DISTANCE_FACTOR.getModeValue(m);
|
||||
// GPS_TOLERANCE - 12 m
|
||||
// 5 seconds: car - 80 m @ 50 kmh, bicyle - 45 m @ 25 km/h, bicyle - 25 m @ 10 km/h, pedestrian - 18 m @ 4 km/h,
|
||||
return RoutingHelper.GPS_TOLERANCE + defaultSpeed * 5 * RoutingHelper.ARRIVAL_DISTANCE_FACTOR;
|
||||
}
|
||||
|
||||
public static void checkAndUpdateStartLocation(@NonNull OsmandApplication app, LatLon newStartLocation) {
|
||||
if (newStartLocation != null) {
|
||||
LatLon lastStartLocation = app.getSettings().getLastStartPoint();
|
||||
if (lastStartLocation == null || MapUtils.getDistance(newStartLocation, lastStartLocation) > CACHE_RADIUS) {
|
||||
app.getMapViewTrackingUtilities().detectDrivingRegion(newStartLocation);
|
||||
app.getSettings().setLastStartPoint(newStartLocation);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void checkAndUpdateStartLocation(@NonNull OsmandApplication app, Location nextStartLocation) {
|
||||
if (nextStartLocation != null) {
|
||||
checkAndUpdateStartLocation(app, new LatLon(nextStartLocation.getLatitude(), nextStartLocation.getLongitude()));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -22,7 +22,6 @@ import net.osmand.plus.R;
|
|||
import net.osmand.plus.render.NativeOsmandLibrary;
|
||||
import net.osmand.plus.routing.RouteCalculationParams.RouteCalculationResultListener;
|
||||
import net.osmand.plus.routing.RouteProvider.RouteService;
|
||||
import net.osmand.plus.routing.RoutingHelper.RouteCalculationProgressCallback;
|
||||
import net.osmand.router.GeneralRouter;
|
||||
|
||||
import net.osmand.router.RouteCalculationProgress;
|
||||
|
@ -564,7 +563,7 @@ public class TransportRoutingHelper {
|
|||
updateProgress(0);
|
||||
RouteCalculationParams walkingRouteParams = getWalkingRouteParams();
|
||||
if (walkingRouteParams != null) {
|
||||
routingHelper.startRouteCalculationThread(walkingRouteParams, true, true);
|
||||
routingHelper.startRouteCalculationThread(walkingRouteParams);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -603,7 +602,7 @@ public class TransportRoutingHelper {
|
|||
}
|
||||
RouteCalculationParams walkingRouteParams = getWalkingRouteParams();
|
||||
if (walkingRouteParams != null) {
|
||||
routingHelper.startRouteCalculationThread(walkingRouteParams, true, true);
|
||||
routingHelper.startRouteCalculationThread(walkingRouteParams);
|
||||
// wait until all segments calculated
|
||||
while (!walkingSegmentsCalculated) {
|
||||
try {
|
||||
|
|
|
@ -15,6 +15,7 @@ import com.google.android.material.slider.Slider;
|
|||
|
||||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.plus.helpers.enums.MetricsConstants;
|
||||
import net.osmand.plus.routing.RoutingHelperUtils;
|
||||
import net.osmand.plus.settings.backend.ApplicationMode;
|
||||
import net.osmand.plus.OsmAndFormatter;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
|
@ -28,7 +29,6 @@ import net.osmand.plus.base.bottomsheetmenu.simpleitems.LongDescriptionItem;
|
|||
import net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerSpaceItem;
|
||||
import net.osmand.plus.base.bottomsheetmenu.simpleitems.SubtitmeListDividerItem;
|
||||
import net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleItem;
|
||||
import net.osmand.plus.routing.RoutingHelper;
|
||||
import net.osmand.plus.settings.fragments.ApplyQueryType;
|
||||
import net.osmand.plus.settings.fragments.OnConfirmPreferenceChange;
|
||||
import net.osmand.plus.settings.preferences.SwitchPreferenceEx;
|
||||
|
@ -207,8 +207,8 @@ public class RecalculateRouteInDeviationBottomSheet extends BooleanPreferenceBot
|
|||
}
|
||||
|
||||
private void getDefaultValue() {
|
||||
currentValue = RoutingHelper.getDefaultAllowedDeviation(settings, appMode,
|
||||
RoutingHelper.getPosTolerance(0));
|
||||
currentValue = RoutingHelperUtils.getDefaultAllowedDeviation(settings, appMode,
|
||||
RoutingHelperUtils.getPosTolerance(0));
|
||||
}
|
||||
|
||||
private int findIndexOfValue(float allowedValue) {
|
||||
|
|
|
@ -33,6 +33,7 @@ import net.osmand.plus.UiUtilities;
|
|||
import net.osmand.plus.Version;
|
||||
import net.osmand.plus.routing.RouteProvider;
|
||||
import net.osmand.plus.routing.RoutingHelper;
|
||||
import net.osmand.plus.routing.RoutingHelperUtils;
|
||||
import net.osmand.plus.settings.backend.ApplicationMode;
|
||||
import net.osmand.plus.settings.backend.BooleanPreference;
|
||||
import net.osmand.plus.settings.backend.CommonPreference;
|
||||
|
@ -432,8 +433,8 @@ public class RouteParametersFragment extends BaseSettingsFragment implements OnP
|
|||
mode.setStrAngle(angleValue[0]);
|
||||
updateAllSettings();
|
||||
RoutingHelper routingHelper = app.getRoutingHelper();
|
||||
if (mode.equals(routingHelper.getAppMode()) && (routingHelper.isRouteCalculated() || routingHelper.isRouteBeingCalculated())) {
|
||||
routingHelper.recalculateRouteDueToSettingsChange();
|
||||
if (mode.equals(routingHelper.getAppMode())) {
|
||||
routingHelper.onSettingsChanged();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -481,7 +482,7 @@ public class RouteParametersFragment extends BaseSettingsFragment implements OnP
|
|||
float allowedValue = settings.ROUTE_RECALCULATION_DISTANCE.getModeValue(appMode);
|
||||
boolean enabled = allowedValue != DISABLE_MODE;
|
||||
if (allowedValue <= 0) {
|
||||
allowedValue = RoutingHelper.getDefaultAllowedDeviation(settings, appMode, RoutingHelper.getPosTolerance(0));
|
||||
allowedValue = RoutingHelperUtils.getDefaultAllowedDeviation(settings, appMode, RoutingHelperUtils.getPosTolerance(0));
|
||||
}
|
||||
String summary = String.format(getString(R.string.ltr_or_rtl_combine_via_bold_point),
|
||||
enabled ? getString(R.string.shared_string_enabled) : getString(R.string.shared_string_disabled),
|
||||
|
@ -644,9 +645,8 @@ public class RouteParametersFragment extends BaseSettingsFragment implements OnP
|
|||
|
||||
private static void recalculateRoute(OsmandApplication app, ApplicationMode mode) {
|
||||
RoutingHelper routingHelper = app.getRoutingHelper();
|
||||
if (mode.equals(routingHelper.getAppMode())
|
||||
&& (routingHelper.isRouteCalculated() || routingHelper.isRouteBeingCalculated())) {
|
||||
routingHelper.recalculateRouteDueToSettingsChange();
|
||||
if (mode.equals(routingHelper.getAppMode())) {
|
||||
routingHelper.onSettingsChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -194,9 +194,8 @@ public class VehicleParametersFragment extends BaseSettingsFragment implements O
|
|||
|
||||
private void recalculateRoute() {
|
||||
RoutingHelper routingHelper = app.getRoutingHelper();
|
||||
if (getSelectedAppMode().equals(routingHelper.getAppMode())
|
||||
&& (routingHelper.isRouteCalculated() || routingHelper.isRouteBeingCalculated())) {
|
||||
routingHelper.recalculateRouteDueToSettingsChange();
|
||||
if (getSelectedAppMode().equals(routingHelper.getAppMode())) {
|
||||
routingHelper.onSettingsChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -269,8 +268,8 @@ public class VehicleParametersFragment extends BaseSettingsFragment implements O
|
|||
mode.setMaxSpeed(maxValue[0] / ratio[0]);
|
||||
}
|
||||
RoutingHelper routingHelper = app.getRoutingHelper();
|
||||
if (mode.equals(routingHelper.getAppMode()) && (routingHelper.isRouteCalculated() || routingHelper.isRouteBeingCalculated())) {
|
||||
routingHelper.recalculateRouteDueToSettingsChange();
|
||||
if (mode.equals(routingHelper.getAppMode())) {
|
||||
routingHelper.onSettingsChanged();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -284,8 +283,8 @@ public class VehicleParametersFragment extends BaseSettingsFragment implements O
|
|||
mode.setMaxSpeed(0f);
|
||||
}
|
||||
RoutingHelper routingHelper = app.getRoutingHelper();
|
||||
if (mode.equals(routingHelper.getAppMode()) && (routingHelper.isRouteCalculated() || routingHelper.isRouteBeingCalculated())) {
|
||||
routingHelper.recalculateRouteDueToSettingsChange();
|
||||
if (mode.equals(routingHelper.getAppMode())) {
|
||||
routingHelper.onSettingsChanged();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -497,7 +497,7 @@ public class MapControlsLayer extends OsmandMapLayer {
|
|||
if (object instanceof SelectedGpxPoint && !((SelectedGpxPoint) object).getSelectedGpxFile().isShowCurrentTrack()) {
|
||||
GPXFile gpxFile = ((SelectedGpxPoint) object).getSelectedGpxFile().getGpxFile();
|
||||
mapActivity.getMapActions().enterRoutePlanningModeGivenGpx(gpxFile, null, null, true, true, MenuState.HEADER_ONLY);
|
||||
routingHelper.recalculateRouteDueToSettingsChange();
|
||||
routingHelper.onSettingsChanged(true);
|
||||
menu.close();
|
||||
} else {
|
||||
if (routingHelper.isFollowingMode() || routingHelper.isRoutePlanningMode()) {
|
||||
|
|
|
@ -49,6 +49,8 @@ import net.osmand.plus.OsmAndFormatter;
|
|||
import net.osmand.plus.OsmAndLocationProvider;
|
||||
import net.osmand.plus.OsmAndLocationProvider.GPSInfo;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.routing.CurrentStreetName;
|
||||
import net.osmand.plus.routing.RoutingHelperUtils;
|
||||
import net.osmand.plus.settings.backend.OsmandSettings;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.UiUtilities;
|
||||
|
@ -933,7 +935,7 @@ public class MapInfoWidgetsFactory {
|
|||
|
||||
|
||||
public boolean updateInfo(DrawSettings d) {
|
||||
RoutingHelper.CurrentStreetName streetName = null;
|
||||
CurrentStreetName streetName = null;
|
||||
boolean showClosestWaypointFirstInAddress = true;
|
||||
if (routingHelper != null && routingHelper.isRouteCalculated() && !routingHelper.isDeviatedFromRoute()) {
|
||||
if (routingHelper.isFollowingMode()) {
|
||||
|
@ -953,11 +955,11 @@ public class MapInfoWidgetsFactory {
|
|||
}
|
||||
} else if (map.getMapViewTrackingUtilities().isMapLinkedToLocation() &&
|
||||
settings.SHOW_STREET_NAME.get()) {
|
||||
streetName = new RoutingHelper.CurrentStreetName();
|
||||
streetName = new CurrentStreetName();
|
||||
RouteDataObject rt = locationProvider.getLastKnownRouteSegment();
|
||||
if (rt != null) {
|
||||
Location lastKnownLocation = locationProvider.getLastKnownLocation();
|
||||
streetName.text = RoutingHelper.formatStreetName(
|
||||
streetName.text = RoutingHelperUtils.formatStreetName(
|
||||
rt.getName(settings.MAP_PREFERRED_LOCALE.get(), settings.MAP_TRANSLITERATE_NAMES.get()),
|
||||
rt.getRef(settings.MAP_PREFERRED_LOCALE.get(), settings.MAP_TRANSLITERATE_NAMES.get(), rt.bearingVsRouteDirection(lastKnownLocation)),
|
||||
rt.getDestinationName(settings.MAP_PREFERRED_LOCALE.get(), settings.MAP_TRANSLITERATE_NAMES.get(), rt.bearingVsRouteDirection(lastKnownLocation)),
|
||||
|
|
Loading…
Reference in a new issue