Merge branch 'sasha_pasha_branch' of ssh://github.com/osmandapp/Osmand into sasha_pasha_branch
This commit is contained in:
commit
d2caee7c0f
2 changed files with 12 additions and 4 deletions
|
@ -306,8 +306,17 @@ public class MapMarkersHelper {
|
||||||
boolean exists = false;
|
boolean exists = false;
|
||||||
|
|
||||||
for (MapMarker marker : dbMarkers) {
|
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;
|
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);
|
dbMarkers.remove(marker);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -511,7 +520,7 @@ public class MapMarkersHelper {
|
||||||
|
|
||||||
MapMarker marker = new MapMarker(point, pointDescription, colorIndex, false, 0);
|
MapMarker marker = new MapMarker(point, pointDescription, colorIndex, false, 0);
|
||||||
if (group != null) {
|
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) {
|
if (markersDbHelper.getMarker(marker.id) != null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -531,7 +540,6 @@ public class MapMarkersHelper {
|
||||||
if (marker != null) {
|
if (marker != null) {
|
||||||
markersDbHelper.updateMarker(marker);
|
markersDbHelper.updateMarker(marker);
|
||||||
if (refresh) {
|
if (refresh) {
|
||||||
loadMarkers();
|
|
||||||
refresh();
|
refresh();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ import java.util.Random;
|
||||||
|
|
||||||
public class MapMarkersDbHelper {
|
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";
|
public static final String DB_NAME = "map_markers_db";
|
||||||
|
|
||||||
private static final String MARKERS_TABLE_NAME = "map_markers";
|
private static final String MARKERS_TABLE_NAME = "map_markers";
|
||||||
|
|
Loading…
Reference in a new issue