From 8a2e953632caa9b9f0e41b6441318f33eb64a224 Mon Sep 17 00:00:00 2001 From: Alexander Sytnyk Date: Wed, 2 Aug 2017 11:20:49 +0300 Subject: [PATCH] Add check --- .../osmand/plus/measurementtool/MeasurementToolLayer.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolLayer.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolLayer.java index 6ec44ab592..ee7924a484 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolLayer.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolLayer.java @@ -134,7 +134,13 @@ public class MeasurementToolLayer extends OsmandMapLayer { WptPt pt = new WptPt(); pt.lat = l.getLatitude(); pt.lon = l.getLongitude(); - measurementPoints.add(pt); + if (measurementPoints.size() > 0) { + if (!measurementPoints.get(measurementPoints.size() - 1).equals(pt)) { + measurementPoints.add(pt); + } + } else { + measurementPoints.add(pt); + } view.refreshMap(); }