From 077f57c830ece37ba069b854c36bb68fe346b841 Mon Sep 17 00:00:00 2001 From: cepprice Date: Wed, 7 Apr 2021 12:10:17 +0500 Subject: [PATCH] Fix route points --- .../views/layers/geometry/MultiProfileGeometryWay.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/views/layers/geometry/MultiProfileGeometryWay.java b/OsmAnd/src/net/osmand/plus/views/layers/geometry/MultiProfileGeometryWay.java index c004dc7fcd..7deff7b264 100644 --- a/OsmAnd/src/net/osmand/plus/views/layers/geometry/MultiProfileGeometryWay.java +++ b/OsmAnd/src/net/osmand/plus/views/layers/geometry/MultiProfileGeometryWay.java @@ -141,9 +141,18 @@ public class MultiProfileGeometryWay extends GeometryWay points = roadSegmentData.getPoints(); + if (points.get(0).getLatitude() != start.getLatitude() && points.get(0).getLongitude() != start.getLongitude()) { + routePoints.add(new LatLon(start.lat, start.lon)); + } for (WptPt routePt : roadSegmentData.getPoints()) { routePoints.add(new LatLon(routePt.lat, routePt.lon)); } + int lastIdx = routePoints.size() - 1; + if (routePoints.get(lastIdx).getLatitude() != end.getLatitude() + && routePoints.get(lastIdx).getLongitude() != end.getLongitude()) { + routePoints.add(new LatLon(end.lat, end.lon)); + } } return routePoints; }