From 561814bd0c995a433174daffada3f19bd25a80ea Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 9 Nov 2017 16:53:12 +0200 Subject: [PATCH] Write the marker name only on one line --- OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java b/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java index 9f69f57b63..516acb3925 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java @@ -240,6 +240,8 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi textAttrs.updatePaints(view, nightMode, tileBox); textAttrs.paint.setStyle(Paint.Style.FILL); + boolean drawMarkerName = map.getMyApplication().getSettings().DISPLAYED_MARKERS_WIDGETS_COUNT.get() == 1; + int locX; int locY; if (map.getMapViewTrackingUtilities().isMapLinkedToLocation() @@ -273,7 +275,7 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi float dist = (float) MapUtils.getDistance(myLoc.getLatitude(), myLoc.getLongitude(), marker.getLatitude(), marker.getLongitude()); String distSt = OsmAndFormatter.getFormattedDistance(dist, view.getApplication()); - String text = distSt + " • " + marker.getName(map); + String text = distSt + (drawMarkerName ? " • " + marker.getName(map) : ""); Rect bounds = new Rect(); textAttrs.paint.getTextBounds(text, 0, text.length(), bounds); float hOffset = pm.getLength() / 2 - bounds.width() / 2;