Changeset 11877 in josm
- Timestamp:
- 2017-04-09T23:45:09+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java
r11858 r11877 282 282 this.baseUrl = GetCapabilitiesParseHelper.normalizeCapabilitiesUrl(handleTemplate(info.getUrl())); 283 283 this.layers = getCapabilities(); 284 this.defaultLayer = info.getDefaultLayers().isEmpty() ? null : (WMTSDefaultLayer) info.getDefaultLayers().iterator().next(); 284 if (info.getDefaultLayers().isEmpty()) { 285 Main.warn(tr("No default layer selected, choosing first layer.")); 286 if (!layers.isEmpty()) { 287 Layer first = layers.iterator().next(); 288 this.defaultLayer = new WMTSDefaultLayer(first.identifier, first.tileMatrixSet.identifier); 289 } else { 290 this.defaultLayer = null; 291 } 292 } else { 293 this.defaultLayer = (WMTSDefaultLayer) info.getDefaultLayers().iterator().next(); 294 } 285 295 if (this.layers.isEmpty()) 286 296 throw new IllegalArgumentException(tr("No layers defined by getCapabilities document: {0}", info.getUrl()));
Note:
See TracChangeset
for help on using the changeset viewer.