avoid redraw when no coordinate system change affects a map that is already shown

This commit is contained in:
Axel Uhl committed 2015-08-12 18:11:26 +02:00
1 parent 67a2c22acc
commit 755af55d0a
3 files changed
+18 -16

No files matched your search

@@ -494,21 +494,23 @@ public class RaceMap extends AbsolutePanel implements TimeListener, CompetitorSe
}
coordinateSystem.setCoordinateSystem(new IdentityCoordinateSystem());
}
fixesAndTails.clearTails();
redraw();
// zooming and setting options while the event loop is still working doesn't work reliably; defer until event loop returns
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
if (map != null) {
map.setOptions(mapOptions);
// ensure zooming to what the settings tell, or defaults if what the settings tell isn't possible right now
mapFirstZoomDone = false;
trueNorthIndicatorPanel.redraw();
orientationChangeInProgress = false;
if (mapOptions != null) { // if no coordinate system change happened that affects an existing map, don't redraw
fixesAndTails.clearTails();
redraw();
// zooming and setting options while the event loop is still working doesn't work reliably; defer until event loop returns
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
if (map != null) {
map.setOptions(mapOptions);
// ensure zooming to what the settings tell, or defaults if what the settings tell isn't possible right now
mapFirstZoomDone = false;
trueNorthIndicatorPanel.redraw();
orientationChangeInProgress = false;
}
}
}
});
});
}
}
private void loadMapsAPIV3(final boolean showMapControls, final boolean showHeaderPanel) {
@@ -66,6 +66,7 @@ public class EmbeddedMapAndWindChartEntryPoint extends AbstractSailingEntryPoint
@Override
protected void doOnModuleLoad() {
GWT.debugger();
super.doOnModuleLoad();
// read mandatory parameters
regattaLikeName = Window.Location.getParameter(PARAM_REGATTA_LIKE_NAME);
@@ -141,7 +142,7 @@ public class EmbeddedMapAndWindChartEntryPoint extends AbstractSailingEntryPoint
final List<RegattaAndRaceIdentifier> raceList = Collections.singletonList(selectedRaceIdentifier);
raceSelectionModel.setSelection(raceList);
final long refreshInterval = Duration.ONE_SECOND.times(3).asMillis();
final Timer timer = new Timer(PlayModes.Live);
final Timer timer = new Timer(PlayModes.Replay);
AsyncActionsExecutor asyncActionsExecutor = new AsyncActionsExecutor();
final TimeRangeWithZoomProvider timeRangeWithZoomProvider = new TimeRangeWithZoomModel();
// Use a TimePanel to manage wind chart zoom, although the TimePanel itself is not being displayed;
@@ -58,7 +58,6 @@ public class RaceBoardEntryPoint extends AbstractSailingEntryPoint {
@Override
protected void doOnModuleLoad() {
GWT.debugger();
super.doOnModuleLoad();
EntryPointHelper.registerASyncService((ServiceDefTarget) mediaService, RemoteServiceMappingConstants.mediaServiceRemotePath);
// read mandatory parameters