Changeset 15411 in josm for trunk/src


Ignore:
Timestamp:
2019-10-04T00:35:55+02:00 (6 years ago)
Author:
Don-vip
Message:

add robustness

File:
1 edited

Legend:

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

    r15410 r15411  
    376376                    LatLon center = info.getBounds().getCenter();
    377377                    if (!first.getBbox().bounds(center)) {
    378                         first = layers.stream().filter(l -> l.getBbox().bounds(center)).findFirst().orElse(first);
     378                        final Layer ffirst = first;
     379                        first = layers.stream()
     380                                .filter(l -> l.getMaxZoom() >= info.getMaxZoom() && l.getBbox() != null && l.getBbox().bounds(center)).findFirst()
     381                                .orElseGet(() -> layers.stream().filter(l -> l.getBbox() != null && l.getBbox().bounds(center)).findFirst()
     382                                        .orElse(ffirst));
    379383                    }
    380384                }
Note: See TracChangeset for help on using the changeset viewer.