Fix show personal parking point as Parking point

This commit is contained in:
Dima-1 2020-01-02 17:50:43 +02:00
parent e5ee6bde78
commit c3637d72ca
3 changed files with 15 additions and 3 deletions

View file

@ -704,8 +704,14 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment implemen
selectedGroupPos = groupPos; selectedGroupPos = groupPos;
selectedChildPos = childPos; selectedChildPos = childPos;
LatLon location = new LatLon(point.getLatitude(), point.getLongitude()); LatLon location = new LatLon(point.getLatitude(), point.getLongitude());
String pointType;
if (point.isPersonal() && point.getName().equals(FavouritePoint.PointType.PARKING.getName())) {
pointType = PointDescription.POINT_TYPE_PARKING_MARKER;
} else {
pointType = PointDescription.POINT_TYPE_FAVORITE;
}
FavoritesActivity.showOnMap(requireActivity(), this, location.getLatitude(), location.getLongitude(), FavoritesActivity.showOnMap(requireActivity(), this, location.getLatitude(), location.getLongitude(),
settings.getLastKnownMapZoom(), new PointDescription(PointDescription.POINT_TYPE_FAVORITE, point.getName(app)), true, point); settings.getLastKnownMapZoom(), new PointDescription(pointType, point.getName(app)), true, point);
} }
@Override @Override

View file

@ -184,7 +184,11 @@ public abstract class MenuController extends BaseMenuController implements Colla
if (object instanceof Amenity) { if (object instanceof Amenity) {
menuController = new AmenityMenuController(mapActivity, pointDescription, (Amenity) object); menuController = new AmenityMenuController(mapActivity, pointDescription, (Amenity) object);
} else if (object instanceof FavouritePoint) { } else if (object instanceof FavouritePoint) {
if (pointDescription.isParking()) {
menuController = new ParkingPositionMenuController(mapActivity, pointDescription);
} else {
menuController = new FavouritePointMenuController(mapActivity, pointDescription, (FavouritePoint) object); menuController = new FavouritePointMenuController(mapActivity, pointDescription, (FavouritePoint) object);
}
} else if (object instanceof SearchHistoryHelper.HistoryEntry) { } else if (object instanceof SearchHistoryHelper.HistoryEntry) {
menuController = new HistoryMenuController(mapActivity, pointDescription, (SearchHistoryHelper.HistoryEntry) object); menuController = new HistoryMenuController(mapActivity, pointDescription, (SearchHistoryHelper.HistoryEntry) object);
} else if (object instanceof TargetPoint) { } else if (object instanceof TargetPoint) {

View file

@ -204,10 +204,12 @@ public class FavouritesLayer extends OsmandMapLayer implements ContextMenuLayer.
int x = (int) tb.getPixXFromLatLon(n.getLatitude(), n.getLongitude()); int x = (int) tb.getPixXFromLatLon(n.getLatitude(), n.getLongitude());
int y = (int) tb.getPixYFromLatLon(n.getLatitude(), n.getLongitude()); int y = (int) tb.getPixYFromLatLon(n.getLatitude(), n.getLongitude());
if (calculateBelongs(ex, ey, x, y, r)) { if (calculateBelongs(ex, ey, x, y, r)) {
if (!n.getName().equals(FavouritePoint.PointType.PARKING.getName())) {
res.add(n); res.add(n);
} }
} }
} }
}
@Override @Override