diff --git a/OsmAnd-java/src/main/java/net/osmand/data/MapObject.java b/OsmAnd-java/src/main/java/net/osmand/data/MapObject.java index 7d3efda165..b4d3f1118e 100644 --- a/OsmAnd-java/src/main/java/net/osmand/data/MapObject.java +++ b/OsmAnd-java/src/main/java/net/osmand/data/MapObject.java @@ -211,6 +211,10 @@ public abstract class MapObject implements Comparable { location = new LatLon(latitude, longitude); } + public void setLocation(LatLon loc) { + location = loc; + } + @Override public int compareTo(MapObject o) { return OsmAndCollator.primaryCollator().compare(getName(), o.getName()); diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapRemoteUtil.java b/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapRemoteUtil.java index 750272622d..88b30c09ca 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapRemoteUtil.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapRemoteUtil.java @@ -467,6 +467,9 @@ public class OpenstreetmapRemoteUtil implements OpenstreetmapUtil { if (entity != null) { if (!isWay && entity instanceof Node) { // check whether this is node (because id of node could be the same as relation) + if (object instanceof NativeLibrary.RenderedObject && object.getLocation() == null) { + object.setLocation(((NativeLibrary.RenderedObject) object).getLabelLatLon()); + } if (MapUtils.getDistance(entity.getLatLon(), object.getLocation()) < 50) { if (object instanceof Amenity) { return replaceEditOsmTags((Amenity) object, entity);