Merge pull request #8875 from osmandapp/poi_edit_location_fix_8839
fix edit poi location #8839
This commit is contained in:
commit
cd4296b27a
2 changed files with 7 additions and 0 deletions
|
@ -211,6 +211,10 @@ public abstract class MapObject implements Comparable<MapObject> {
|
||||||
location = new LatLon(latitude, longitude);
|
location = new LatLon(latitude, longitude);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setLocation(LatLon loc) {
|
||||||
|
location = loc;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(MapObject o) {
|
public int compareTo(MapObject o) {
|
||||||
return OsmAndCollator.primaryCollator().compare(getName(), o.getName());
|
return OsmAndCollator.primaryCollator().compare(getName(), o.getName());
|
||||||
|
|
|
@ -467,6 +467,9 @@ public class OpenstreetmapRemoteUtil implements OpenstreetmapUtil {
|
||||||
if (entity != null) {
|
if (entity != null) {
|
||||||
if (!isWay && entity instanceof Node) {
|
if (!isWay && entity instanceof Node) {
|
||||||
// check whether this is node (because id of node could be the same as relation)
|
// 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 (MapUtils.getDistance(entity.getLatLon(), object.getLocation()) < 50) {
|
||||||
if (object instanceof Amenity) {
|
if (object instanceof Amenity) {
|
||||||
return replaceEditOsmTags((Amenity) object, entity);
|
return replaceEditOsmTags((Amenity) object, entity);
|
||||||
|
|
Loading…
Reference in a new issue