- Timestamp:
- 2016-02-28T14:06:46+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java
r9897 r9899 48 48 true); 49 49 50 private ScaleList nativeScaleList;50 private static final ScaleList nativeScaleList = initNativeScaleList(); 51 51 52 52 /** … … 56 56 public TMSLayer(ImageryInfo info) { 57 57 super(info); 58 Collection<Double> scales = new ArrayList<>(info.getMaxZoom());59 for (int zoom = AbstractTileSourceLayer.MIN_ZOOM; zoom <= AbstractTileSourceLayer.MAX_ZOOM; zoom++) {60 double scale = OsmMercator.EARTH_RADIUS * Math.PI * 2 / Math.pow(2, zoom) / OsmMercator.DEFAUL_TILE_SIZE;61 scales.add(scale);62 }63 this.nativeScaleList = new ScaleList(scales);64 58 } 65 59 … … 162 156 return nativeScaleList; 163 157 } 158 159 private static ScaleList initNativeScaleList() { 160 Collection<Double> scales = new ArrayList<>(AbstractTileSourceLayer.MAX_ZOOM); 161 for (int zoom = AbstractTileSourceLayer.MIN_ZOOM; zoom <= AbstractTileSourceLayer.MAX_ZOOM; zoom++) { 162 double scale = OsmMercator.EARTH_RADIUS * Math.PI * 2 / Math.pow(2, zoom) / OsmMercator.DEFAUL_TILE_SIZE; 163 scales.add(scale); 164 } 165 return new ScaleList(scales); 166 } 164 167 }
Note:
See TracChangeset
for help on using the changeset viewer.