diff --git a/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java b/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java index 3f734e0e5a..96674888da 100644 --- a/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java +++ b/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java @@ -819,6 +819,7 @@ public class OsmandAidlApi { PointDescription pd = new PointDescription( PointDescription.POINT_TYPE_MAP_MARKER, markerNew.getName() != null ? markerNew.getName() : ""); MapMarker marker = new MapMarker(m.point, pd, m.colorIndex, m.selected, m.index); + marker.id = m.id; marker.creationDate = m.creationDate; marker.visitedDate = m.visitedDate; markersHelper.moveMapMarker(marker, latLonNew); diff --git a/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java b/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java index 60d9370b72..6ab73a355f 100644 --- a/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java +++ b/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java @@ -589,7 +589,6 @@ public class FavouritesDbHelper { return true; } - //todo public void editFavouriteGroup(FavoriteGroup group, String newName, int color, boolean visible) { MapMarkersHelper markersHelper = context.getMapMarkersHelper(); if (color != 0 && group.color != color) { @@ -605,6 +604,7 @@ public class FavouritesDbHelper { for (FavouritePoint p : gr.points) { p.setVisible(visible); } + markersHelper.syncGroup(new MarkersSyncGroup(gr.name, gr.name, MarkersSyncGroup.FAVORITES_TYPE)); } if (!group.name.equals(newName)) { FavoriteGroup gr = flatGroups.remove(group.name); diff --git a/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java b/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java index e686cebb4b..19a8477bec 100644 --- a/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java +++ b/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java @@ -301,7 +301,12 @@ public class MapMarkersHelper { List dbMarkers = markersDbHelper.getMarkersFromGroup(group); if (group.getType() == MarkersSyncGroup.FAVORITES_TYPE) { - List favPoints = ctx.getFavorites().getGroup(group.name).points; + FavouritesDbHelper.FavoriteGroup favGroup = ctx.getFavorites().getGroup(group.name); + if (!favGroup.visible) { + removeActiveMarkersFromSyncGroup(group.id); + return; + } + List favPoints = favGroup.points; for (FavouritePoint fp : favPoints) { LatLon fpLatLon = new LatLon(fp.getLatitude(), fp.getLongitude()); boolean exists = false; @@ -498,6 +503,7 @@ public class MapMarkersHelper { } } checkAndFixActiveMarkersOrderIfNeeded(); + refresh(); } }