Fix adding markers

This commit is contained in:
PavelRatushny 2017-11-13 12:34:50 +02:00
parent 8280a0ed06
commit 00f2f4b143

View file

@ -761,7 +761,7 @@ public class MapMarkersHelper {
private void addMarkers(List<LatLon> points, List<PointDescription> historyNames, @Nullable MarkersSyncGroup group, boolean enabled) { private void addMarkers(List<LatLon> points, List<PointDescription> historyNames, @Nullable MarkersSyncGroup group, boolean enabled) {
if (points.size() > 0) { if (points.size() > 0) {
int colorIndex = -1; int colorIndex = -1;
List<MapMarker> mapMarkers = new ArrayList<>(); List<MapMarker> addedMarkers = new ArrayList<>();
for (int i = 0; i < points.size(); i++) { for (int i = 0; i < points.size(); i++) {
LatLon point = points.get(i); LatLon point = points.get(i);
PointDescription historyName = historyNames.get(i); PointDescription historyName = historyNames.get(i);
@ -799,11 +799,11 @@ public class MapMarkersHelper {
if (enabled) { if (enabled) {
mapMarkers.add(0, marker); mapMarkers.add(0, marker);
} }
mapMarkers.add(marker); addedMarkers.add(marker);
reorderActiveMarkersIfNeeded(); reorderActiveMarkersIfNeeded();
lookupAddress(marker); lookupAddress(marker);
} }
addMarkersToGroups(mapMarkers, enabled); addMarkersToGroups(addedMarkers, enabled);
} }
} }