From: Keith Packard Date: Sun, 7 Oct 2018 21:11:03 +0000 (-0700) Subject: altosuilib: Leave some map debug code around for the future X-Git-Tag: 1.8.7~3^2~3 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=2bcbd39a37cf1fa0002345d5c401869a387dc84f 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 --- 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);