summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2018-10-07 14:11:03 -0700
committerKeith Packard <keithp@keithp.com>2018-10-07 14:12:02 -0700
commit2bcbd39a37cf1fa0002345d5c401869a387dc84f (patch)
treeb55726a749a7fdaddf0f13501b03a0822fcc6d9a
parent444fdd96515cc7163c49942ac2435ace8e7bb5bf (diff)
altosuilib: Leave some map debug code around for the future
Displays lat/lon on each map tile. Commented out for production use. Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--altosuilib/AltosUIMap.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/altosuilib/AltosUIMap.java b/altosuilib/AltosUIMap.java
index b375e168..8dfdba64 100644
--- a/altosuilib/AltosUIMap.java
+++ b/altosuilib/AltosUIMap.java
@@ -264,6 +264,21 @@ public class AltosUIMap extends JComponent implements AltosFlightDisplay, AltosM
if (image != null) {
g.drawImage(image, point.x, point.y, null);
+/*
+ * Useful when debugging map fetching problems
+ *
+ String message = String.format("%.6f %.6f", center.lat, center.lon);
+ g.setFont(tile_font);
+ g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
+ Rectangle2D bounds = tile_font.getStringBounds(message, g.getFontRenderContext());
+
+ float x = px_size / 2.0f;
+ float y = px_size / 2.0f;
+ x = x - (float) bounds.getWidth() / 2.0f;
+ y = y + (float) bounds.getHeight() / 2.0f;
+ g.setColor(Color.RED);
+ g.drawString(message, (float) point_double.x + x, (float) point_double.y + y);
+*/
} else {
g.setColor(Color.GRAY);
g.fillRect(point.x, point.y, px_size, px_size);