AltosSiteMapPreload: only load 49 maps
authorAnthony Towns <aj@erisian.com.au>
Sun, 19 Jan 2014 18:52:43 +0000 (04:52 +1000)
committerAnthony Towns <aj@erisian.com.au>
Sun, 19 Jan 2014 18:52:43 +0000 (04:52 +1000)
Google Static Maps API limits queries to 50 maps per IP per minute,
so querying a 7x7 array instead of a 9x9 array seems more likely to
work well.

altosui/AltosSiteMapPreload.java

index fd648abccc2424d5bad08c2ee7c9f85e08796bf7..7112fed680b36c83c2a2894d02a4a329631e9cd8 100644 (file)
@@ -213,7 +213,7 @@ public class AltosSiteMapPreload extends AltosUIDialog implements ActionListener
        AltosMapPos     lat;
        AltosMapPos     lon;
 
-       final static int        radius = 4;
+       final static int        radius = 3;
        final static int        width = (radius * 2 + 1);
        final static int        height = (radius * 2 + 1);
 
@@ -326,7 +326,7 @@ public class AltosSiteMapPreload extends AltosUIDialog implements ActionListener
 
                pane.setLayout(new GridBagLayout());
 
-               map = new AltosSiteMap(4);
+               map = new AltosSiteMap(radius);
 
                c.fill = GridBagConstraints.BOTH;
                c.anchor = GridBagConstraints.CENTER;
@@ -464,4 +464,4 @@ public class AltosSiteMapPreload extends AltosUIDialog implements ActionListener
                setLocationRelativeTo(owner);
                setVisible(true);
        }
-}
\ No newline at end of file
+}