Changeset 9818 in josm for trunk/src/org/openstreetmap/josm/data/imagery
- Timestamp:
- 2016-02-17T23:27:47+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java
r9799 r9818 47 47 import org.openstreetmap.josm.data.projection.Projections; 48 48 import org.openstreetmap.josm.gui.ExtendedDialog; 49 import org.openstreetmap.josm.gui.layer.NativeScaleLayer.Scale; 50 import org.openstreetmap.josm.gui.layer.NativeScaleLayer.ScaleList; 49 51 import org.openstreetmap.josm.io.CachedFile; 50 52 import org.openstreetmap.josm.tools.CheckParameterUtil; … … 286 288 } 287 289 288 private Collection<Layer> getCapabilities() throws IOException{290 private Collection<Layer> getCapabilities() { 289 291 XMLInputFactory factory = XMLInputFactory.newFactory(); 290 292 // do not try to load external entities, nor validate the XML … … 709 711 return null; 710 712 } 711 if (zoom < 1) {713 if (zoom < 0) { 712 714 return null; 713 715 } 714 return this.currentTileMatrixSet.tileMatrix.get(zoom - 1);716 return this.currentTileMatrixSet.tileMatrix.get(zoom); 715 717 } 716 718 … … 830 832 public int getMaxZoom() { 831 833 if (this.currentTileMatrixSet != null) { 832 return this.currentTileMatrixSet.tileMatrix.size() ;834 return this.currentTileMatrixSet.tileMatrix.size()-1; 833 835 } 834 836 return 0; … … 911 913 return (int) Math.ceil(Math.abs(max.east() - min.east()) / scale); 912 914 } 915 916 /** 917 * Get native scales of tile source. 918 * @return {@link ScaleList} of native scales 919 */ 920 public ScaleList getNativeScales() { 921 ScaleList scales = new ScaleList(); 922 if (currentTileMatrixSet != null) { 923 for (TileMatrix tileMatrix : currentTileMatrixSet.tileMatrix) { 924 scales.add(new Scale(tileMatrix.scaleDenominator * 0.28e-03)); 925 } 926 } 927 return scales; 928 } 929 913 930 }
Note:
See TracChangeset
for help on using the changeset viewer.