Changeset 8649 in josm for trunk/src/org/openstreetmap/josm/data/imagery
- Timestamp:
- 2015-08-08T18:32:10+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSource.java
r8647 r8649 37 37 */ 38 38 public class TemplatedWMSTileSource extends TMSTileSource implements TemplatedTileSource { 39 private Map<String, String> headers = new ConcurrentHashMap<>();39 private final Map<String, String> headers = new ConcurrentHashMap<>(); 40 40 private final Set<String> serverProjections; 41 41 private EastNorth topLeftCorner; 42 42 private Bounds worldBounds; 43 private int[] tileXMax; 44 private int[] tileYMax; 43 45 44 46 private static final Pattern PATTERN_HEADER = Pattern.compile("\\{header\\(([^,]+),([^}]+)\\)\\}"); … … 89 91 EastNorth max = proj.latlon2eastNorth(worldBounds.getMax()); 90 92 this.topLeftCorner = new EastNorth(min.east(), max.north()); 93 94 LatLon bottomRight = new LatLon(worldBounds.getMinLat(), worldBounds.getMaxLon()); 95 tileXMax = new int[getMaxZoom() + 1]; 96 tileYMax = new int[getMaxZoom() + 1]; 97 for(int zoom = getMinZoom(); zoom <= getMaxZoom(); zoom++) { 98 TileXY maxTileIndex = latLonToTileXY(bottomRight.toCoordinate(), zoom); 99 tileXMax[zoom] = maxTileIndex.getXIndex(); 100 tileYMax[zoom] = maxTileIndex.getYIndex(); 101 } 91 102 } 92 103 … … 229 240 @Override 230 241 public int getTileXMax(int zoom) { 231 LatLon bottomRight = new LatLon(worldBounds.getMinLat(), worldBounds.getMaxLon()); 232 return latLonToTileXY(bottomRight.toCoordinate(), zoom).getXIndex(); 242 return tileXMax[zoom]; 233 243 } 234 244 … … 240 250 @Override 241 251 public int getTileYMax(int zoom) { 242 LatLon bottomRight = new LatLon(worldBounds.getMinLat(), worldBounds.getMaxLon()); 243 return latLonToTileXY(bottomRight.toCoordinate(), zoom).getYIndex(); 252 return tileYMax[zoom]; 244 253 } 245 254
Note:
See TracChangeset
for help on using the changeset viewer.