From ec5cfc435249f53bb0379e243962fb2e8dda558b Mon Sep 17 00:00:00 2001 From: Chumva Date: Mon, 12 Mar 2018 12:52:49 +0200 Subject: [PATCH] added amenity check in getObjectName --- OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java b/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java index 77da9c1d85..b733b51fa3 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java @@ -49,6 +49,8 @@ import java.util.List; import gnu.trove.list.array.TIntArrayList; +import static net.osmand.data.PointDescription.POINT_TYPE_POI; + public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvider, IContextMenuProviderSelection, ContextMenuLayer.IMoveObjectProvider { @@ -589,6 +591,11 @@ 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; }