Changeset 30247 in osm for applications/viewer/jmapviewer


Ignore:
Timestamp:
2014-01-31T14:04:38+01:00 (11 years ago)
Author:
glebius
Message:

Push Random to a smaller scope, where it is rarely used.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/ScanexTileSource.java

    r30246 r30247  
    9797    @Override
    9898    public double tileYToLat(int y, int zoom) {
    99         Random r= new Random();
    10099        double lat0, lat;
    101100
     
    105104            lat = lat - Math.toDegrees(NextTerm(Math.toRadians(lat), y, zoom));
    106105            if (lat > OsmMercator.MAX_LAT || lat < OsmMercator.MIN_LAT) {
     106                Random r = new Random();
    107107                lat = OsmMercator.MIN_LAT +
    108                     (double )r.nextInt((int )(OsmMercator.MAX_LAT -
    109                     OsmMercator.MIN_LAT));
     108                  r.nextInt((int )(OsmMercator.MAX_LAT - OsmMercator.MIN_LAT));
    110109            }
    111110        } while ((Math.abs(lat0 - lat) > 0.000001));
Note: See TracChangeset for help on using the changeset viewer.