Changeset 1797 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2009-07-16T00:41:38+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java
r1740 r1797 8 8 9 9 public class OsmUrlToBounds { 10 10 11 public static Bounds parse(String url) { 11 12 int i = url.indexOf('?'); … … 56 57 } 57 58 58 static public int getZoom(Bounds b) 59 { 59 static public int getZoom(Bounds b) { 60 60 // convert to mercator (for calculation of zoom only) 61 61 double latMin = Math.log(Math.tan(Math.PI/4.0+b.min.lat()/180.0*Math.PI/2.0))*180.0/Math.PI; … … 72 72 } 73 73 74 static public String getURL(Bounds b) 75 { 74 static public String getURL(Bounds b) { 76 75 return getURL(b.getCenter(), getZoom(b)); 77 76 } 78 77 79 static public String getURL(LatLon pos, int zoom) 80 { 78 static public String getURL(LatLon pos, int zoom) { 81 79 // Truncate lat and lon to something more sensible 82 80 int decimals = (int) Math.pow(10, (zoom / 3));
Note:
See TracChangeset
for help on using the changeset viewer.