From a24d5e607ae0a683aba3d91aa6ac083b98a27c0a Mon Sep 17 00:00:00 2001 From: Skalii Date: Tue, 30 Mar 2021 17:33:38 +0300 Subject: [PATCH] fix empty altitude in favorites; --- .../src/main/java/net/osmand/binary/RouteDataObject.java | 5 +++-- OsmAnd/src/net/osmand/data/FavouritePoint.java | 2 +- .../src/net/osmand/plus/mapcontextmenu/MapContextMenu.java | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/RouteDataObject.java b/OsmAnd-java/src/main/java/net/osmand/binary/RouteDataObject.java index 602a2f1682..6e063b8ecb 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/RouteDataObject.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/RouteDataObject.java @@ -38,7 +38,7 @@ public class RouteDataObject { public int[] nameIds; // mixed array [0, height, cumulative_distance height, cumulative_distance, height, ...] - length is length(points)*2 public float[] heightDistanceArray = null; - public float heightByCurrentLocation; + public float heightByCurrentLocation = Float.NaN; private static final Log LOG = PlatformUtil.getLog(RouteDataObject.class); public RouteDataObject(RouteRegion region) { @@ -185,7 +185,8 @@ public class RouteDataObject { heightDistanceArray = new float[2 * getPointsLength()]; double plon = 0; double plat = 0; - float prevHeight = heightByCurrentLocation = startHeight; + float prevHeight = startHeight; + heightByCurrentLocation = Float.NaN; double prevDistance = 0; for (int k = 0; k < getPointsLength(); k++) { double lon = MapUtils.get31LongitudeX(getPoint31XTile(k)); diff --git a/OsmAnd/src/net/osmand/data/FavouritePoint.java b/OsmAnd/src/net/osmand/data/FavouritePoint.java index f87083363f..414299e575 100644 --- a/OsmAnd/src/net/osmand/data/FavouritePoint.java +++ b/OsmAnd/src/net/osmand/data/FavouritePoint.java @@ -45,7 +45,7 @@ public class FavouritePoint implements Serializable, LocationPoint { private boolean visible = true; private SpecialPointType specialPointType = null; private BackgroundType backgroundType = null; - private double altitude; + private double altitude = Double.NaN; private long timestamp; public FavouritePoint() { diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java index 38bf3feb78..cf032a5393 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java @@ -1036,7 +1036,7 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL title = ""; } String originObjectName = ""; - double altitude = 0; + double altitude = Double.NaN; long timestamp = System.currentTimeMillis(); Object object = getObject(); if (object != null) {