Fix typeName

(cherry picked from commit 1b32bbc)
This commit is contained in:
PavelRatushny 2017-07-28 12:16:43 +03:00
parent cceeb8df94
commit 45f33cc5d6

View file

@ -283,9 +283,17 @@ public class TrackSegmentFragment extends OsmAndListFragment {
LatLon location = new LatLon(pointToShow.getLatitude(),
pointToShow.getLongitude());
final OsmandSettings settings = app.getSettings();
String typeName = "";
if (getGpx().showCurrentTrack) {
typeName = getString(R.string.shared_string_currently_recording_track);
} else if (getGpxDataItem() != null) {
typeName = getGpxDataItem().getFile().getName();
} else if (getGpx() != null) {
typeName = getGpx().path;
}
settings.setMapLocationToShow(location.getLatitude(), location.getLongitude(),
settings.getLastKnownMapZoom(),
new PointDescription(PointDescription.POINT_TYPE_WPT, getGpxDataItem() != null ? getGpxDataItem().getFile().getName() : ""),
new PointDescription(PointDescription.POINT_TYPE_WPT, typeName),
false,
getRect()
);