diff --git a/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java b/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java index 037030610a..6ce78edacd 100644 --- a/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java +++ b/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java @@ -306,8 +306,17 @@ public class MapMarkersHelper { boolean exists = false; for (MapMarker marker : dbMarkers) { - if (marker.point.equals(fpLatLon) && marker.getName(ctx).equals(fp.getName(ctx))) { + if (marker.id.equals(group.getId() + fp.getName(ctx))) { exists = true; + if (!marker.history && !marker.point.equals(fpLatLon)) { + for (MapMarker m : mapMarkers) { + if (m.id.equals(marker.id)) { + m.point = fpLatLon; + updateMapMarker(m, true); + break; + } + } + } dbMarkers.remove(marker); break; } @@ -511,7 +520,7 @@ public class MapMarkersHelper { MapMarker marker = new MapMarker(point, pointDescription, colorIndex, false, 0); if (group != null) { - marker.id = group.getId() + marker.getName(ctx) + marker.getLatitude() + marker.getLongitude(); + marker.id = group.getId() + marker.getName(ctx); if (markersDbHelper.getMarker(marker.id) != null) { continue; } @@ -531,7 +540,6 @@ public class MapMarkersHelper { if (marker != null) { markersDbHelper.updateMarker(marker); if (refresh) { - loadMarkers(); refresh(); } } diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDbHelper.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDbHelper.java index 9a6c779fdd..a6804667bb 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDbHelper.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDbHelper.java @@ -21,7 +21,7 @@ import java.util.Random; public class MapMarkersDbHelper { - private static final int DB_VERSION = 6; + private static final int DB_VERSION = 1; public static final String DB_NAME = "map_markers_db"; private static final String MARKERS_TABLE_NAME = "map_markers";