Changeset 30243 in osm for applications/viewer
- Timestamp:
- 2014-01-31T11:23:43+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/ScanexTileSource.java
r30224 r30243 97 97 @Override 98 98 public double tileYToLat(int y, int zoom) { 99 Random r= new Random();99 Random r= new Random(); 100 100 double lat0, lat; 101 101 102 lat = cached_lat;103 do {104 lat0 = lat;102 lat = cached_lat; 103 do { 104 lat0 = lat; 105 105 lat = lat - Math.toDegrees(NextTerm(Math.toRadians(lat), y, zoom)); 106 106 if (lat > OsmMercator.MAX_LAT || lat < OsmMercator.MIN_LAT) { … … 109 109 OsmMercator.MIN_LAT)); 110 110 } 111 } while ((Math.abs(lat0 - lat) > 0.000001));111 } while ((Math.abs(lat0 - lat) > 0.000001)); 112 112 113 cached_lat = lat;113 cached_lat = lat; 114 114 115 115 return (lat); … … 120 120 double sinl=Math.sin(lat); 121 121 double cosl=Math.cos(lat); 122 double ec, f, df;122 double ec, f, df; 123 123 124 124 zoom = (int )Math.pow(2.0, zoom - 1); 125 ec = Math.exp((1 - y/zoom)*Math.PI);125 ec = Math.exp((1 - y/zoom)*Math.PI); 126 126 127 f = (Math.tan(Math.PI/4+lat/2) -128 ec * Math.pow(Math.tan(Math.PI/4 + Math.asin(E * sinl)/2), E));127 f = (Math.tan(Math.PI/4+lat/2) - 128 ec * Math.pow(Math.tan(Math.PI/4 + Math.asin(E * sinl)/2), E)); 129 129 df = 1/(1 - sinl) - ec * E * cosl/((1 - E * sinl) * 130 130 (Math.sqrt (1 - E * E * sinl * sinl)));
Note:
See TracChangeset
for help on using the changeset viewer.