Changeset 15409 in josm for trunk/src/org
- Timestamp:
- 2019-10-03T22:02:47+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java
r14572 r15409 183 183 return crs; 184 184 } 185 186 /** 187 * Returns tile matrix max zoom. Assumes first zoom starts at 0, with continuous zoom levels. 188 * @return tile matrix max zoom 189 * @since 15409 190 */ 191 public int getMaxZoom() { 192 return tileMatrix.size() - 1; 193 } 185 194 } 186 195 … … 258 267 public TileMatrixSet getTileMatrixSet() { 259 268 return tileMatrixSet; 269 } 270 271 /** 272 * Returns layer max zoom. 273 * @return layer max zoom 274 * @since 15409 275 */ 276 public int getMaxZoom() { 277 return tileMatrixSet != null ? tileMatrixSet.getMaxZoom() : 0; 260 278 } 261 279 } … … 334 352 if (!layers.isEmpty()) { 335 353 Layer first = layers.iterator().next(); 354 // If max zoom lower than expected, try to find a better layer 355 if (first.getMaxZoom() < info.getMaxZoom()) { 356 first = layers.stream().filter(l -> l.getMaxZoom() >= info.getMaxZoom()).findFirst().orElse(first); 357 } 336 358 this.defaultLayer = new DefaultLayer(info.getImageryType(), first.identifier, first.style, first.tileMatrixSet.identifier); 337 359 } else { … … 943 965 public int getMaxZoom() { 944 966 if (this.currentTileMatrixSet != null) { 945 return this.currentTileMatrixSet. tileMatrix.size()-1;967 return this.currentTileMatrixSet.getMaxZoom(); 946 968 } 947 969 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.