Merge pull request #11292 from osmandapp/fix_altitude_in_favorites

Fix empty altitude in favorites
This commit is contained in:
vshcherb 2021-03-30 18:50:00 +02:00 committed by GitHub
commit e880f99a25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View file

@ -38,7 +38,7 @@ public class RouteDataObject {
public int[] nameIds; public int[] nameIds;
// mixed array [0, height, cumulative_distance height, cumulative_distance, height, ...] - length is length(points)*2 // mixed array [0, height, cumulative_distance height, cumulative_distance, height, ...] - length is length(points)*2
public float[] heightDistanceArray = null; public float[] heightDistanceArray = null;
public float heightByCurrentLocation; public float heightByCurrentLocation = Float.NaN;
private static final Log LOG = PlatformUtil.getLog(RouteDataObject.class); private static final Log LOG = PlatformUtil.getLog(RouteDataObject.class);
public RouteDataObject(RouteRegion region) { public RouteDataObject(RouteRegion region) {
@ -185,7 +185,8 @@ public class RouteDataObject {
heightDistanceArray = new float[2 * getPointsLength()]; heightDistanceArray = new float[2 * getPointsLength()];
double plon = 0; double plon = 0;
double plat = 0; double plat = 0;
float prevHeight = heightByCurrentLocation = startHeight; float prevHeight = startHeight;
heightByCurrentLocation = Float.NaN;
double prevDistance = 0; double prevDistance = 0;
for (int k = 0; k < getPointsLength(); k++) { for (int k = 0; k < getPointsLength(); k++) {
double lon = MapUtils.get31LongitudeX(getPoint31XTile(k)); double lon = MapUtils.get31LongitudeX(getPoint31XTile(k));

View file

@ -45,7 +45,7 @@ public class FavouritePoint implements Serializable, LocationPoint {
private boolean visible = true; private boolean visible = true;
private SpecialPointType specialPointType = null; private SpecialPointType specialPointType = null;
private BackgroundType backgroundType = null; private BackgroundType backgroundType = null;
private double altitude; private double altitude = Double.NaN;
private long timestamp; private long timestamp;
public FavouritePoint() { public FavouritePoint() {

View file

@ -1036,7 +1036,7 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL
title = ""; title = "";
} }
String originObjectName = ""; String originObjectName = "";
double altitude = 0; double altitude = Double.NaN;
long timestamp = System.currentTimeMillis(); long timestamp = System.currentTimeMillis();
Object object = getObject(); Object object = getObject();
if (object != null) { if (object != null) {