mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-14 22:43:57 +00:00
fixed bug regarding erasing last maneuvers received from server
Change-Id: I3288685cc0e440a9d9aff16ab15ae1161c246e1b
This commit is contained in:
1 parent
3bcbbd57cc
commit
59a3431d5d
2 files changed
+23
-5
No files matched your search
+22
-3
@@ -118,7 +118,12 @@ public class ManeuverMarkersAndLossIndicators {
|
||||
});
|
||||
}
|
||||
|
||||
protected void removeAllManeuverMarkers() {
|
||||
/**
|
||||
* Removes the visualizations of maneuvers from the map. The maneuver objects as received from the server are remembered
|
||||
* (see {@link #lastManeuverResult}) and may be restored by a subsequent call to {@link #showManeuvers(Map)} as it is, e.g.,
|
||||
* called by {@link #updateManeuverMarkersAfterSettingsChanged()}.
|
||||
*/
|
||||
void removeAllManeuverMarkers() {
|
||||
// clone entry set to avoid concurrent modification exception
|
||||
for (final Entry<Triple<String, Date, ManeuverType>, Marker> keyAndMarker : new HashSet<>(maneuverMarkers.entrySet())) {
|
||||
removeManeuverMarker(keyAndMarker.getKey(), keyAndMarker.getValue());
|
||||
@@ -257,8 +262,9 @@ public class ManeuverMarkersAndLossIndicators {
|
||||
}
|
||||
maneuverLossLinesMap.remove(key);
|
||||
}
|
||||
if (maneuverLossInfoOverlayMap.remove(key) != null) {
|
||||
maneuverLossInfoOverlayMap.get(key).removeFromMap();
|
||||
final SmallTransparentInfoOverlay overlay;
|
||||
if ((overlay=maneuverLossInfoOverlayMap.remove(key)) != null) {
|
||||
overlay.removeFromMap();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -401,4 +407,17 @@ public class ManeuverMarkersAndLossIndicators {
|
||||
showManeuvers(lastManeuverResult);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all maneuver displays from the map and also clears the structure holding the maneuvers
|
||||
* last received from the server so that upon the next request to show maneuvers without a previous
|
||||
* update from the server no maneuvers will be displayed.<p>
|
||||
*
|
||||
* @see #getAndShowManeuvers(RegattaAndRaceIdentifier, Map)
|
||||
* @see #removeAllManeuverMarkers()
|
||||
*/
|
||||
void clearAllManeuverMarkers() {
|
||||
removeAllManeuverMarkers();
|
||||
lastManeuverResult = null;
|
||||
}
|
||||
}
|
||||
+1
-2
@@ -1062,7 +1062,7 @@ public class RaceMap extends AbstractCompositeComponent<RaceMapSettings> impleme
|
||||
if (douglasMarkers != null) {
|
||||
removeAllMarkDouglasPeuckerpoints();
|
||||
}
|
||||
maneuverMarkersAndLossIndicators.removeAllManeuverMarkers();
|
||||
maneuverMarkersAndLossIndicators.clearAllManeuverMarkers();
|
||||
if (requiresCoordinateSystemUpdateWhenCoursePositionAndWindDirectionIsKnown) {
|
||||
updateCoordinateSystemFromSettings();
|
||||
}
|
||||
@@ -1093,7 +1093,6 @@ public class RaceMap extends AbstractCompositeComponent<RaceMapSettings> impleme
|
||||
}
|
||||
zoomMapToNewBounds(zoomToBounds);
|
||||
mapFirstZoomDone = true;
|
||||
|
||||
updateEstimatedDuration(raceMapDataDTO.estimatedDuration);
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user