Open needed location by clicking on bitmap

This commit is contained in:
PavelRatushny 2017-06-29 11:30:24 +03:00
parent 3807f8f367
commit ecd2dc4763

View file

@ -277,7 +277,8 @@ public class TrackSegmentFragment extends OsmAndListFragment {
headerView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
LatLon location = new LatLon(generalDisplayItem.locationStart.lat, generalDisplayItem.locationStart.lon);
LatLon location = new LatLon((generalDisplayItem.analysis.bottom + generalDisplayItem.analysis.top) / 2,
(generalDisplayItem.analysis.left + generalDisplayItem.analysis.right) / 2);
final OsmandSettings settings = app.getSettings();
settings.setMapLocationToShow(location.getLatitude(), location.getLongitude(),
settings.getLastKnownMapZoom());