diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index 689bfa3640..32f917d08a 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -47,6 +47,7 @@ import net.osmand.core.android.AtlasMapRendererView; import net.osmand.data.LatLon; import net.osmand.data.PointDescription; import net.osmand.data.QuadPoint; +import net.osmand.data.QuadRect; import net.osmand.data.RotatedTileBox; import net.osmand.map.MapTileDownloader.DownloadRequest; import net.osmand.map.MapTileDownloader.IMapDownloaderCallback; @@ -841,6 +842,9 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven mapContextMenu.showMinimized(latLonToShow, mapLabelToShow, toShow); mapLayers.getMapControlsLayer().getMapRouteInfoMenu().updateMenu(); 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 { mapContextMenu.show(latLonToShow, mapLabelToShow, toShow); } diff --git a/OsmAnd/src/net/osmand/plus/myplaces/TrackSegmentFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/TrackSegmentFragment.java index 84f5a3eb30..681e6f50b5 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/TrackSegmentFragment.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/TrackSegmentFragment.java @@ -277,11 +277,15 @@ public class TrackSegmentFragment extends OsmAndListFragment { headerView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - LatLon location = new LatLon((generalDisplayItem.analysis.bottom + generalDisplayItem.analysis.top) / 2, - (generalDisplayItem.analysis.left + generalDisplayItem.analysis.right) / 2); + LatLon location = new LatLon(generalDisplayItem.locationStart.lat, + generalDisplayItem.locationStart.lon); final OsmandSettings settings = app.getSettings(); settings.setMapLocationToShow(location.getLatitude(), location.getLongitude(), - settings.getLastKnownMapZoom()); + settings.getLastKnownMapZoom(), + new PointDescription(PointDescription.POINT_TYPE_WPT, generalDisplayItem.name), + false, + getRect() + ); MapActivity.launchMapActivityMoveToTop(getActivity()); }