fix for bug in last commit

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7027 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 14 years ago
parent b12bfe1f91
commit b480b7a4d0

@ -31,7 +31,6 @@ import java.io.IOException;
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import javax.imageio.ImageIO;
@ -130,7 +129,6 @@ public class OSMTile {
}
}
public static final Random r = new Random(System.currentTimeMillis()); // to select tile server
public static class tileCoordinates {
int xtile, ytile, zoom;
@ -151,7 +149,7 @@ public class OSMTile {
public String url(int retry) {
// see http://wiki.openstreetmap.org/wiki/Public_Domain_Map
int hash = (xtile + 7 * ytile + 13 * zoom + retry) % 4;
String host = (hash == 3) ? "tile.openstreetmap.org" : ((char) ((int)'a' + r.nextInt(3))) + ".tile.openstreetmap.org";
String host = (hash == 3) ? "tile.openstreetmap.org" : ((char) ((int)'a' + hash)) + ".tile.openstreetmap.org";
String url = "http://" + host + "/" + zoom + "/" + xtile + "/" + ytile + ".png";
//System.out.println("OSM URL = " + url);
return url;

Loading…
Cancel
Save