altosuilib: Show launch sites at all visible locations on map
[fw/altos] / altosuilib / AltosUIMap.java
index 58371f05a090d892f88bc4f74ade73763a00039b..0a80959fe80a9c02416968f8e35beed860f03f3e 100644 (file)
@@ -48,37 +48,43 @@ public class AltosUIMap extends JComponent implements AltosFlightDisplay, AltosM
 
        class MapMark extends AltosMapMark {
                public void paint(AltosMapTransform t) {
-                       AltosPointDouble pt = t.screen(lat_lon);
+                       double lat = lat_lon.lat;
+                       double lon;
+                       double first_lon = t.first_lon(lat_lon.lon);
+                       double last_lon = t.last_lon(lat_lon.lon);
+                       for (lon = first_lon; lon <= last_lon; lon += 360.0) {
+                               AltosPointDouble pt = t.screen(lat, lon);
 
-                       g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
-                                          RenderingHints.VALUE_ANTIALIAS_ON);
-                       g.setStroke(new BasicStroke(stroke_width, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
+                               g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
+                                                  RenderingHints.VALUE_ANTIALIAS_ON);
+                               g.setStroke(new BasicStroke(stroke_width, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
 
-                       if (0 <= state && state < AltosUIMap.stateColors.length)
-                               g.setColor(AltosUIMap.stateColors[state]);
-                       else
-                               g.setColor(AltosUIMap.stateColors[AltosLib.ao_flight_invalid]);
-
-                       g.drawOval((int)pt.x-5, (int)pt.y-5, 10, 10);
-                       g.drawOval((int)pt.x-20, (int)pt.y-20, 40, 40);
-                       g.drawOval((int)pt.x-35, (int)pt.y-35, 70, 70);
-
-                       if (label != null) {
-                               Rectangle2D     bounds;
-                               bounds = line_font.getStringBounds(label, g.getFontRenderContext());
-                               float x = (float) pt.x;
-                               float y = (float) pt.y + (float) bounds.getHeight() / 2.0f;
-
-                               g.setFont(line_font);
-                               g.setColor(Color.WHITE);
-                               for (int dy = -2; dy <= 2; dy += 2)
-                                       for (int dx = -2; dx <= 2; dx += 2)
-                                               g.drawString(label, x + dx, y + dy);
                                if (0 <= state && state < AltosUIMap.stateColors.length)
                                        g.setColor(AltosUIMap.stateColors[state]);
                                else
                                        g.setColor(AltosUIMap.stateColors[AltosLib.ao_flight_invalid]);
-                               g.drawString(label, x, y);
+
+                               g.drawOval((int)pt.x-5, (int)pt.y-5, 10, 10);
+                               g.drawOval((int)pt.x-20, (int)pt.y-20, 40, 40);
+                               g.drawOval((int)pt.x-35, (int)pt.y-35, 70, 70);
+
+                               if (label != null) {
+                                       Rectangle2D     bounds;
+                                       bounds = line_font.getStringBounds(label, g.getFontRenderContext());
+                                       float x = (float) pt.x;
+                                       float y = (float) pt.y + (float) bounds.getHeight() / 2.0f;
+
+                                       g.setFont(line_font);
+                                       g.setColor(Color.WHITE);
+                                       for (int dy = -2; dy <= 2; dy += 2)
+                                               for (int dx = -2; dx <= 2; dx += 2)
+                                                       g.drawString(label, x + dx, y + dy);
+                                       if (0 <= state && state < AltosUIMap.stateColors.length)
+                                               g.setColor(AltosUIMap.stateColors[state]);
+                                       else
+                                               g.setColor(AltosUIMap.stateColors[AltosLib.ao_flight_invalid]);
+                                       g.drawString(label, x, y);
+                               }
                        }
                }