Do not calc route to first marker

This commit is contained in:
crimean 2019-03-08 11:54:11 +03:00
parent 930e294d67
commit 3d1096caba
2 changed files with 0 additions and 23 deletions

View file

@ -411,9 +411,6 @@ public class MapActivityActions implements DialogProvider {
public void enterDirectionsFromPoint(final double latitude, final double longitude) {
mapActivity.getContextMenu().hide();
if (getMyApplication().getTargetPointsHelper().getPointToNavigate() == null) {
setFirstMapMarkerAsTarget();
}
if (!mapActivity.getRoutingHelper().isFollowingMode() && !mapActivity.getRoutingHelper().isRoutePlanningMode()) {
enterRoutePlanningMode(new LatLon(latitude, longitude),
mapActivity.getContextMenu().getPointDescription());
@ -1073,19 +1070,4 @@ public class MapActivityActions implements DialogProvider {
getMyApplication().getAppCustomization().restoreOsmand();
mapActivity.closeDrawer();
}
public void setFirstMapMarkerAsTarget() {
if (getMyApplication().getMapMarkersHelper().getMapMarkers().size() > 0) {
MapMarkersHelper.MapMarker marker = getMyApplication().getMapMarkersHelper().getMapMarkers().get(0);
PointDescription pointDescription = marker.getOriginalPointDescription();
if (pointDescription.isLocation()
&& pointDescription.getName().equals(PointDescription.getAddressNotFoundStr(mapActivity))) {
pointDescription = new PointDescription(PointDescription.POINT_TYPE_LOCATION, "");
}
TargetPointsHelper targets = getMyApplication().getTargetPointsHelper();
targets.navigateToPoint(new LatLon(marker.getLatitude(), marker.getLongitude()),
true, targets.getIntermediatePoints().size() + 1, pointDescription);
}
}
}

View file

@ -413,11 +413,6 @@ public class MapControlsLayer extends OsmandMapLayer {
MapActivity.clearPrevActivityIntent();
RoutingHelper routingHelper = mapActivity.getRoutingHelper();
if (!routingHelper.isFollowingMode() && !routingHelper.isRoutePlanningMode()) {
if (!hasTargets) {
if (getTargets().getPointToNavigate() == null) {
mapActivity.getMapActions().setFirstMapMarkerAsTarget();
}
}
TargetPoint start = getTargets().getPointToStart();
if (start != null) {
mapActivity.getMapActions().enterRoutePlanningMode(