From f7aa832c9e32e8f2a4b2bed093b045b07d012455 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Tue, 16 Jul 2013 00:46:39 +0200 Subject: [PATCH] Add lat/lon for object added from map --- .../plus/activities/MapActivityActions.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java index 49e4a794d8..df7b444d70 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java @@ -949,15 +949,15 @@ public class MapActivityActions implements DialogProvider { String name = mapActivity.getMapLayers().getContextMenuLayer().getSelectedObjectName(); getDirections(loc, name, DirectionDialogStyle.create().gpxRouteEnabled().routeFromMapPoint()); } - } else if (standardId == R.string.context_menu_item_intermediate_point) { + } else if (standardId == R.string.context_menu_item_intermediate_point || + standardId == R.string.context_menu_item_destination_point) { + boolean dest = standardId == R.string.context_menu_item_destination_point; String selected = mapActivity.getMapLayers().getContextMenuLayer().getSelectedObjectName(); - int sz = targets.getIntermediatePoints().size(); - targets.navigateToPoint(new LatLon(latitude, longitude), true, sz, selected); - IntermediatePointsDialog.openIntermediatePointsDialog(mapActivity); - // For button-less search UI - } else if (standardId == R.string.context_menu_item_destination_point) { - String selected = mapActivity.getMapLayers().getContextMenuLayer().getSelectedObjectName(); - targets.navigateToPoint(new LatLon(latitude, longitude), true, -1, selected); + if(selected == null){ + selected = mapActivity.getString(R.string.route_descr_lat_lon, latitude, longitude); + } + targets.navigateToPoint(new LatLon(latitude, longitude), true, + dest ? -1 : targets.getIntermediatePoints().size(), selected); IntermediatePointsDialog.openIntermediatePointsDialog(mapActivity); } else if (standardId == R.string.context_menu_item_share_location) { shareLocation(latitude, longitude, mapActivity.getMapView().getZoom());