Merge branch 'sasha_pasha_branch' of ssh://github.com/osmandapp/Osmand into sasha_pasha_branch
This commit is contained in:
commit
adfadc91d9
2 changed files with 20 additions and 9 deletions
|
@ -327,14 +327,18 @@ public class MapMarkersHelper {
|
|||
}
|
||||
|
||||
public void addMapMarker(LatLon point, PointDescription historyName) {
|
||||
List<LatLon> points = new ArrayList<>(1);
|
||||
List<PointDescription> historyNames = new ArrayList<>(1);
|
||||
points.add(point);
|
||||
historyNames.add(historyName);
|
||||
addMapMarkers(points, historyNames);
|
||||
addMarkers(Collections.singletonList(point), Collections.singletonList(historyName), null);
|
||||
}
|
||||
|
||||
public void addMapMarkers(List<LatLon> points, List<PointDescription> historyNames, List<String> groups) {
|
||||
addMarkers(points, historyNames, groups);
|
||||
}
|
||||
|
||||
public void addMapMarkers(List<LatLon> points, List<PointDescription> historyNames) {
|
||||
addMarkers(points, historyNames, null);
|
||||
}
|
||||
|
||||
private void addMarkers(List<LatLon> points, List<PointDescription> historyNames, @Nullable List<String> groups) {
|
||||
if (points.size() > 0) {
|
||||
int colorIndex = -1;
|
||||
for (int i = 0; i < points.size(); i++) {
|
||||
|
@ -360,6 +364,9 @@ public class MapMarkersHelper {
|
|||
}
|
||||
|
||||
MapMarker marker = new MapMarker(point, pointDescription, colorIndex, false, 0);
|
||||
if (groups != null) {
|
||||
marker.groupKey = markersDbHelper.createGroupIfNeeded(groups.get(i));
|
||||
}
|
||||
markersDbHelper.addMarker(marker);
|
||||
}
|
||||
loadMarkers();
|
||||
|
|
|
@ -404,11 +404,15 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
|||
int size = getSelectedFavoritesCount();
|
||||
List<LatLon> points = new ArrayList<>(size);
|
||||
List<PointDescription> names = new ArrayList<>(size);
|
||||
for (FavouritePoint fp : getSelectedFavorites()) {
|
||||
points.add(new LatLon(fp.getLatitude(), fp.getLongitude()));
|
||||
names.add(new PointDescription(PointDescription.POINT_TYPE_MAP_MARKER, fp.getName()));
|
||||
List<String> groups = new ArrayList<>(size);
|
||||
for (Map.Entry<String, Set<FavouritePoint>> entry : favoritesSelected.entrySet()) {
|
||||
for (FavouritePoint fp : entry.getValue()) {
|
||||
points.add(new LatLon(fp.getLatitude(), fp.getLongitude()));
|
||||
names.add(new PointDescription(PointDescription.POINT_TYPE_MAP_MARKER, fp.getName()));
|
||||
groups.add(entry.getKey());
|
||||
}
|
||||
}
|
||||
markersHelper.addMapMarkers(points, names);
|
||||
markersHelper.addMapMarkers(points, names, groups);
|
||||
MapActivity.launchMapActivityMoveToTop(getActivity());
|
||||
} else {
|
||||
final TargetPointsHelper targetPointsHelper = getMyApplication().getTargetPointsHelper();
|
||||
|
|
Loading…
Reference in a new issue