Fix markers import
This commit is contained in:
parent
09345faefc
commit
b6a90eb774
2 changed files with 10 additions and 14 deletions
|
@ -187,14 +187,8 @@ public class EditFavoriteGroupDialogFragment extends BottomSheetDialogFragment {
|
||||||
addToMarkersView.setOnClickListener(new View.OnClickListener() {
|
addToMarkersView.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
List<LatLon> points = new ArrayList<>(group.points.size());
|
|
||||||
List<PointDescription> names = new ArrayList<>(group.points.size());
|
|
||||||
for (FavouritePoint fp : group.points) {
|
|
||||||
points.add(new LatLon(fp.getLatitude(), fp.getLongitude()));
|
|
||||||
names.add(new PointDescription(PointDescription.POINT_TYPE_MAP_MARKER, fp.getName()));
|
|
||||||
}
|
|
||||||
markersHelper.addMarkersSyncGroup(syncGroup);
|
markersHelper.addMarkersSyncGroup(syncGroup);
|
||||||
markersHelper.addMapMarkers(points, names, syncGroup);
|
markersHelper.syncGroup(syncGroup);
|
||||||
dismiss();
|
dismiss();
|
||||||
MapActivity.launchMapActivityMoveToTop(getActivity());
|
MapActivity.launchMapActivityMoveToTop(getActivity());
|
||||||
}
|
}
|
||||||
|
|
|
@ -411,7 +411,8 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
new MarkersSyncGroup(favGr.name, favGr.name, MarkersSyncGroup.FAVORITES_TYPE, favGr.color);
|
new MarkersSyncGroup(favGr.name, favGr.name, MarkersSyncGroup.FAVORITES_TYPE, favGr.color);
|
||||||
if (entry.getValue().size() == favGr.points.size()) {
|
if (entry.getValue().size() == favGr.points.size()) {
|
||||||
markersHelper.addMarkersSyncGroup(syncGr);
|
markersHelper.addMarkersSyncGroup(syncGr);
|
||||||
}
|
markersHelper.syncGroup(syncGr);
|
||||||
|
} else {
|
||||||
for (FavouritePoint fp : entry.getValue()) {
|
for (FavouritePoint fp : entry.getValue()) {
|
||||||
points.add(new LatLon(fp.getLatitude(), fp.getLongitude()));
|
points.add(new LatLon(fp.getLatitude(), fp.getLongitude()));
|
||||||
names.add(new PointDescription(PointDescription.POINT_TYPE_MAP_MARKER, fp.getName()));
|
names.add(new PointDescription(PointDescription.POINT_TYPE_MAP_MARKER, fp.getName()));
|
||||||
|
@ -420,6 +421,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
points.clear();
|
points.clear();
|
||||||
names.clear();
|
names.clear();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
MapActivity.launchMapActivityMoveToTop(getActivity());
|
MapActivity.launchMapActivityMoveToTop(getActivity());
|
||||||
} else {
|
} else {
|
||||||
final TargetPointsHelper targetPointsHelper = getMyApplication().getTargetPointsHelper();
|
final TargetPointsHelper targetPointsHelper = getMyApplication().getTargetPointsHelper();
|
||||||
|
|
Loading…
Reference in a new issue