Merge remote-tracking branch 'origin/master'

This commit is contained in:
fmittag committed 2012-06-20 09:53:59 +02:00
commit d49e82b9e2
4 files changed
+165 -49

No files matched your search

@@ -536,20 +536,22 @@ public class RaceMap extends AbsolutePanel implements TimeListener, CompetitorSe
protected void showMarksOnMap(CourseDTO courseDTO) {
if (map != null && courseDTO != null) {
Set<MarkDTO> toRemove = new HashSet<MarkDTO>(buoyMarkers.keySet());
for (MarkDTO markDTO : courseDTO.buoys) {
Marker buoyMarker = buoyMarkers.get(markDTO);
if (buoyMarker == null) {
buoyMarker = createBuoyMarker(markDTO);
buoyMarkers.put(markDTO, buoyMarker);
map.addOverlay(buoyMarker);
} else {
buoyMarker.setLatLng(LatLng.newInstance(markDTO.position.latDeg, markDTO.position.lngDeg));
toRemove.remove(markDTO);
if (courseDTO.buoys != null) {
for (MarkDTO markDTO : courseDTO.buoys) {
Marker buoyMarker = buoyMarkers.get(markDTO);
if (buoyMarker == null) {
buoyMarker = createBuoyMarker(markDTO);
buoyMarkers.put(markDTO, buoyMarker);
map.addOverlay(buoyMarker);
} else {
buoyMarker.setLatLng(LatLng.newInstance(markDTO.position.latDeg, markDTO.position.lngDeg));
toRemove.remove(markDTO);
}
}
for (MarkDTO toRemoveMarkDTO : toRemove) {
Marker marker = buoyMarkers.remove(toRemoveMarkDTO);
map.removeOverlay(marker);
}
}
for (MarkDTO toRemoveMarkDTO : toRemove) {
Marker marker = buoyMarkers.remove(toRemoveMarkDTO);
map.removeOverlay(marker);
}
}
}