Merge pull request #3996 from osmandapp/gpx_improvements

Gpx improvements
This commit is contained in:
vshcherb 2017-06-29 14:35:53 +02:00 committed by GitHub
commit a49d743c1a
2 changed files with 11 additions and 2 deletions

View file

@ -47,6 +47,7 @@ import net.osmand.core.android.AtlasMapRendererView;
import net.osmand.data.LatLon; import net.osmand.data.LatLon;
import net.osmand.data.PointDescription; import net.osmand.data.PointDescription;
import net.osmand.data.QuadPoint; import net.osmand.data.QuadPoint;
import net.osmand.data.QuadRect;
import net.osmand.data.RotatedTileBox; import net.osmand.data.RotatedTileBox;
import net.osmand.map.MapTileDownloader.DownloadRequest; import net.osmand.map.MapTileDownloader.DownloadRequest;
import net.osmand.map.MapTileDownloader.IMapDownloaderCallback; import net.osmand.map.MapTileDownloader.IMapDownloaderCallback;
@ -868,6 +869,9 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
mapContextMenu.showMinimized(latLonToShow, mapLabelToShow, toShow); mapContextMenu.showMinimized(latLonToShow, mapLabelToShow, toShow);
mapLayers.getMapControlsLayer().getMapRouteInfoMenu().updateMenu(); mapLayers.getMapControlsLayer().getMapRouteInfoMenu().updateMenu();
MapRouteInfoMenu.showLocationOnMap(this, latLonToShow.getLatitude(), latLonToShow.getLongitude()); MapRouteInfoMenu.showLocationOnMap(this, latLonToShow.getLatitude(), latLonToShow.getLongitude());
} else if (toShow instanceof QuadRect) {
QuadRect qr = (QuadRect) toShow;
mapView.fitRectToMap(qr.left, qr.right, qr.top, qr.bottom, (int) qr.width(), (int) qr.height(), 0);
} else { } else {
mapContextMenu.show(latLonToShow, mapLabelToShow, toShow); mapContextMenu.show(latLonToShow, mapLabelToShow, toShow);
} }

View file

@ -277,10 +277,15 @@ public class TrackSegmentFragment extends OsmAndListFragment {
headerView.setOnClickListener(new View.OnClickListener() { headerView.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
LatLon location = new LatLon(generalDisplayItem.locationStart.lat, generalDisplayItem.locationStart.lon); LatLon location = new LatLon(generalDisplayItem.locationStart.lat,
generalDisplayItem.locationStart.lon);
final OsmandSettings settings = app.getSettings(); final OsmandSettings settings = app.getSettings();
settings.setMapLocationToShow(location.getLatitude(), location.getLongitude(), settings.setMapLocationToShow(location.getLatitude(), location.getLongitude(),
settings.getLastKnownMapZoom()); settings.getLastKnownMapZoom(),
new PointDescription(PointDescription.POINT_TYPE_WPT, generalDisplayItem.name),
false,
getRect()
);
MapActivity.launchMapActivityMoveToTop(getActivity()); MapActivity.launchMapActivityMoveToTop(getActivity());
} }