Changeset 11773 in josm for trunk/src/org
- Timestamp:
- 2017-03-24T22:30:25+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java
r11559 r11773 356 356 if (event == XMLStreamReader.START_ELEMENT) { 357 357 if (QN_LAYER.equals(reader.getName())) { 358 layers.add(parseLayer(reader)); 358 Layer l = parseLayer(reader); 359 if (l != null) { 360 layers.add(l); 361 } 359 362 } 360 363 if (QN_TILEMATRIXSET.equals(reader.getName())) { … … 387 390 Stack<QName> tagStack = new Stack<>(); 388 391 List<String> supportedMimeTypes = Arrays.asList(ImageIO.getReaderMIMETypes()); 392 Collection<String> unsupportedFormats = new ArrayList<>(); 389 393 390 394 for (int event = reader.getEventType(); … … 398 402 if (supportedMimeTypes.contains(format)) { 399 403 layer.format = format; 404 } else { 405 unsupportedFormats.add(format); 400 406 } 401 407 } else if (GetCapabilitiesParseHelper.QN_OWS_IDENTIFIER.equals(reader.getName())) { … … 428 434 if (layer.style == null) { 429 435 layer.style = ""; 436 } 437 if (layer.format == null) { 438 // no format found - it's mandatory parameter - can't use this layer 439 Main.warn(tr("Can''t use layer {0} because no supported formats where found. Layer is available in formats: {1}", 440 layer.name, 441 String.join(", ", unsupportedFormats))); 442 return null; 430 443 } 431 444 return layer;
Note:
See TracChangeset
for help on using the changeset viewer.