parent
53acf00f1a
commit
3a7232c8b4
3 changed files with 16 additions and 14 deletions
|
@ -88,6 +88,7 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL
|
|||
private LatLon mapCenter;
|
||||
private int mapPosition = 0;
|
||||
private boolean centerMarker;
|
||||
private boolean zoomOutOnly;
|
||||
private int mapZoom;
|
||||
|
||||
private boolean inLocationUpdate = false;
|
||||
|
@ -286,6 +287,14 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL
|
|||
this.centerMarker = centerMarker;
|
||||
}
|
||||
|
||||
public boolean isZoomOutOnly() {
|
||||
return zoomOutOnly;
|
||||
}
|
||||
|
||||
public void setZoomOutOnly(boolean zoomOutOnly) {
|
||||
this.zoomOutOnly = zoomOutOnly;
|
||||
}
|
||||
|
||||
public int getMapZoom() {
|
||||
return mapZoom;
|
||||
}
|
||||
|
|
|
@ -1734,10 +1734,11 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
|
|||
|
||||
private void showOnMap(LatLon latLon, boolean updateCoords, boolean alreadyAdjusted, int zoom) {
|
||||
AnimateDraggingMapThread thread = map.getAnimatedDraggingThread();
|
||||
int calculatedZoom = thread.calculateMoveZoom(null, latLon.getLatitude(), latLon.getLongitude(), null);
|
||||
int calculatedZoom = menu.isZoomOutOnly() ? thread.calculateMoveZoom(null, latLon.getLatitude(), latLon.getLongitude(), null) : 0;
|
||||
if (calculatedZoom > 0) {
|
||||
zoom = Math.min(zoom, calculatedZoom);
|
||||
}
|
||||
menu.setZoomOutOnly(false);
|
||||
LatLon calcLatLon = calculateCenterLatLon(latLon, zoom, updateCoords);
|
||||
if (updateCoords) {
|
||||
mapCenter = calcLatLon;
|
||||
|
|
|
@ -60,7 +60,7 @@ public class TransportRouteController extends MenuController {
|
|||
public void buttonPressed() {
|
||||
final int previousStop = getPreviousStop();
|
||||
if (previousStop != -1) {
|
||||
showTransportStop(getTransportRoute().route.getForwardStops().get(previousStop));
|
||||
showTransportStop(getTransportRoute().route.getForwardStops().get(previousStop), true);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -72,7 +72,7 @@ public class TransportRouteController extends MenuController {
|
|||
public void buttonPressed() {
|
||||
final int nextStop = getNextStop();
|
||||
if (nextStop != -1) {
|
||||
showTransportStop(getTransportRoute().route.getForwardStops().get(nextStop));
|
||||
showTransportStop(getTransportRoute().route.getForwardStops().get(nextStop), true);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -180,7 +180,7 @@ public class TransportRouteController extends MenuController {
|
|||
}
|
||||
}
|
||||
|
||||
private void showTransportStop(TransportStop stop) {
|
||||
private void showTransportStop(TransportStop stop, boolean movingBetweenStops) {
|
||||
MapActivity mapActivity = getMapActivity();
|
||||
if (mapActivity != null && mapContextMenu != null) {
|
||||
transportRoute.stop = stop;
|
||||
|
@ -198,6 +198,7 @@ public class TransportRouteController extends MenuController {
|
|||
mapContextMenu.setMapPosition(getMapActivity().getMapView().getMapPosition());
|
||||
}
|
||||
mapContextMenu.setCenterMarker(true);
|
||||
mapContextMenu.setZoomOutOnly(movingBetweenStops);
|
||||
mapContextMenu.setMapZoom(15);
|
||||
mapContextMenu.showOrUpdate(stopLocation, pd, transportRoute);
|
||||
}
|
||||
|
@ -286,16 +287,7 @@ public class TransportRouteController extends MenuController {
|
|||
|
||||
@Override
|
||||
public void onClick(View arg0) {
|
||||
showTransportStop(stop);
|
||||
/*
|
||||
PointDescription pd = new PointDescription(PointDescription.POINT_TYPE_TRANSPORT_STOP,
|
||||
getMapActivity().getString(R.string.transport_Stop), name);
|
||||
LatLon stopLocation = stop.getLocation();
|
||||
getMapActivity().getMyApplication().getSettings()
|
||||
.setMapLocationToShow(stopLocation.getLatitude(), stopLocation.getLongitude(),
|
||||
15, pd, false, transportRoute);
|
||||
MapActivity.launchMapActivityMoveToTop(getMapActivity());
|
||||
*/
|
||||
showTransportStop(stop, false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue