Changeset 10033 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint
- Timestamp:
- 2016-03-23T21:52:44+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java
r9239 r10033 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.gui.mappaint.mapcss; 3 4 import static org.openstreetmap.josm.data.projection.Ellipsoid.WGS84; 3 5 4 6 import java.util.Collection; … … 637 639 } 638 640 639 private static final double R = 6378135;640 641 641 public static double level2scale(int lvl) { 642 642 if (lvl < 0) … … 644 644 // preliminary formula - map such that mapnik imagery tiles of the same 645 645 // or similar level are displayed at the given scale 646 return 2.0 * Math.PI * R/ Math.pow(2.0, lvl) / 2.56;646 return 2.0 * Math.PI * WGS84.a / Math.pow(2.0, lvl) / 2.56; 647 647 } 648 648 … … 650 650 if (scale < 0) 651 651 throw new IllegalArgumentException("scale must be >= 0 but is "+scale); 652 return (int) Math.floor(Math.log(2 * Math.PI * R/ 2.56 / scale) / Math.log(2));652 return (int) Math.floor(Math.log(2 * Math.PI * WGS84.a / 2.56 / scale) / Math.log(2)); 653 653 } 654 654
Note:
See TracChangeset
for help on using the changeset viewer.