From 62c3327e44c34ebe2a0a4c0e6a2a2e783de4af7e Mon Sep 17 00:00:00 2001 From: Leif Gruenwoldt Date: Sun, 9 Feb 2020 13:19:48 -0500 Subject: [PATCH] Fix issue downloading OSM tiles The user-agent is required now to download OSM tiles. Was seeing "The tileserver could not be reached." before making this change. More info about the policy can be found here: https://operations.osmfoundation.org/policies/tiles/ --- src/com/roots/map/MapPanel.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/com/roots/map/MapPanel.java b/src/com/roots/map/MapPanel.java index 16e798f..a795194 100644 --- a/src/com/roots/map/MapPanel.java +++ b/src/com/roots/map/MapPanel.java @@ -1939,6 +1939,9 @@ public static void launchUI() { } public static void main(String[] args) { + // HTTP User-agent is required to be set by OSM Tile Usage Policy to avoid an error. + System.setProperty("http.agent", "MapPanel app (https://github.com/srutz/mappanel)"); + SwingUtilities.invokeLater(new Runnable() { public void run() { try {