Hide markers with favorites

This commit is contained in:
Alexander Sytnyk 2017-09-14 15:12:53 +03:00
parent 8defa928b2
commit 7ab38e525f
2 changed files with 8 additions and 1 deletions

View file

@ -605,6 +605,7 @@ public class FavouritesDbHelper {
for (FavouritePoint p : gr.points) { for (FavouritePoint p : gr.points) {
p.setVisible(visible); p.setVisible(visible);
} }
markersHelper.syncGroup(new MarkersSyncGroup(gr.name, gr.name, MarkersSyncGroup.FAVORITES_TYPE));
} }
if (!group.name.equals(newName)) { if (!group.name.equals(newName)) {
FavoriteGroup gr = flatGroups.remove(group.name); FavoriteGroup gr = flatGroups.remove(group.name);

View file

@ -301,7 +301,12 @@ public class MapMarkersHelper {
List<MapMarker> dbMarkers = markersDbHelper.getMarkersFromGroup(group); List<MapMarker> dbMarkers = markersDbHelper.getMarkersFromGroup(group);
if (group.getType() == MarkersSyncGroup.FAVORITES_TYPE) { if (group.getType() == MarkersSyncGroup.FAVORITES_TYPE) {
List<FavouritePoint> favPoints = ctx.getFavorites().getGroup(group.name).points; FavouritesDbHelper.FavoriteGroup favGroup = ctx.getFavorites().getGroup(group.name);
if (!favGroup.visible) {
removeActiveMarkersFromSyncGroup(group.id);
return;
}
List<FavouritePoint> favPoints = favGroup.points;
for (FavouritePoint fp : favPoints) { for (FavouritePoint fp : favPoints) {
LatLon fpLatLon = new LatLon(fp.getLatitude(), fp.getLongitude()); LatLon fpLatLon = new LatLon(fp.getLatitude(), fp.getLongitude());
boolean exists = false; boolean exists = false;
@ -498,6 +503,7 @@ public class MapMarkersHelper {
} }
} }
checkAndFixActiveMarkersOrderIfNeeded(); checkAndFixActiveMarkersOrderIfNeeded();
refresh();
} }
} }