re-use polyline paths

This commit is contained in:
Axel Uhl committed 2015-12-02 18:44:32 +01:00
1 parent 983d0cbbb0
commit aa2dcbacc1
1 file changed
+3 -5
@@ -1301,11 +1301,11 @@ public class RaceMap extends AbsolutePanel implements TimeListener, CompetitorSe
options.setStrokeOpacity(0.5);
advantageLine = Polyline.newInstance(options);
Hoverline advantageHoverline = new Hoverline(advantageLine, options, this);
MVCArray<LatLng> pointsAsArray = MVCArray.newInstance();
pointsAsArray.insertAt(0, advantageLinePos1);
pointsAsArray.insertAt(1, advantageLinePos2);
advantageLine.setPath(pointsAsArray);
Hoverline advantageHoverline = new Hoverline(advantageLine, options, this);
advantageLineMouseOverHandler = new AdvantageLineMouseOverMapHandler(
bearingOfCombinedWindInDeg, new Date(windFix.measureTimepoint));
@@ -1561,8 +1561,8 @@ public class RaceMap extends AbsolutePanel implements TimeListener, CompetitorSe
options.setStrokeOpacity(1.0);
pointsAsArray = MVCArray.newInstance();
lineToShowOrRemoveOrUpdate = Polyline.newInstance(options);
Hoverline lineToShowOrRemoveOrUpdateHoverline = new Hoverline(lineToShowOrRemoveOrUpdate, options, this);
lineToShowOrRemoveOrUpdate.setPath(pointsAsArray);
Hoverline lineToShowOrRemoveOrUpdateHoverline = new Hoverline(lineToShowOrRemoveOrUpdate, options, this);
lineToShowOrRemoveOrUpdate.addMouseOverHandler(new MouseOverMapHandler() {
@Override
public void onEvent(MouseOverMapEvent event) {
@@ -2501,11 +2501,9 @@ public class RaceMap extends AbsolutePanel implements TimeListener, CompetitorSe
public Polyline createTail(final CompetitorDTO competitor, List<LatLng> points) {
PolylineOptions options = createTailStyle(competitor, displayHighlighted(competitor));
Polyline result = Polyline.newInstance(options);
Hoverline resultHoverline = new Hoverline(result, options, this);
MVCArray<LatLng> pointsAsArray = MVCArray.newInstance(points.toArray(new LatLng[0]));
result.setPath(pointsAsArray);
Hoverline resultHoverline = new Hoverline(result, options, this);
final ClickMapHandler clickHandler = new ClickMapHandler() {
@Override
public void onEvent(ClickMapEvent event) {