From 2838bb127baf61f508adff8dec6273a74dd3a14a Mon Sep 17 00:00:00 2001 From: Chumva Date: Mon, 12 Mar 2018 13:04:43 +0200 Subject: [PATCH] deleted changes in getObjectName --- OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java b/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java index b733b51fa3..2a958af750 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java @@ -577,11 +577,9 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi public LatLon getObjectLocation(Object o) { if (o instanceof MapMarker) { return ((MapMarker) o).point; - } else if (o instanceof Amenity) { + } else if (o instanceof Amenity && amenities.contains(o)) { Amenity amenity = (Amenity) o; - if (amenities.contains(amenity)) { - return amenity.getLocation(); - } + return amenity.getLocation(); } return null; } @@ -591,11 +589,6 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi public PointDescription getObjectName(Object o) { if (o instanceof MapMarker) { return ((MapMarker) o).getPointDescription(view.getContext()); - } else if (o instanceof Amenity) { - Amenity amenity = (Amenity) o; - if (amenities.contains(amenity)) { - return new PointDescription(POINT_TYPE_POI, amenity.getName()); - } } return null; }