Changeset 13539 in josm for trunk/src


Ignore:
Timestamp:
2018-03-18T15:13:52+01:00 (7 years ago)
Author:
Don-vip
Message:

fix #16084 - WMTS: support different tile sizes for layers using the same projection

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java

    r13510 r13539  
    738738            return cachedTileSize;
    739739        }
    740         if (tileProjection != null) {
     740        if (currentTileMatrixSet != null) {
    741741            // no support for non-square tiles (tileHeight != tileWidth)
    742742            // and for different tile sizes at different zoom levels
    743             Collection<Layer> projLayers = getLayers(null, tileProjection.toCode());
    744             if (!projLayers.isEmpty()) {
    745                 cachedTileSize = projLayers.iterator().next().tileMatrixSet.tileMatrix.get(0).tileHeight;
    746                 return cachedTileSize;
    747             }
    748         }
    749         // if no layers is found, fallback to default mercator tile size. Maybe it will work
     743            cachedTileSize = currentTileMatrixSet.tileMatrix.get(0).tileHeight;
     744            return cachedTileSize;
     745        }
     746        // Fallback to default mercator tile size. Maybe it will work
    750747        Logging.warn("WMTS: Could not determine tile size. Using default tile size of: {0}", getDefaultTileSize());
    751748        return getDefaultTileSize();
Note: See TracChangeset for help on using the changeset viewer.