Changeset 11559 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2017-02-14T00:21:56+01:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/imagery
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoaderJob.java
r11553 r11559 110 110 if (url == null) { 111 111 synchronized (this) { 112 if (url == null) 113 url = new URL(tile.getUrl()); 112 if (url == null) { 113 String sUrl = tile.getUrl(); 114 if (!"".equals(sUrl)) { 115 url = new URL(sUrl); 116 } 117 } 114 118 } 115 119 } … … 151 155 try { 152 156 super.submit(this, force); 153 } catch (IOException e) {157 } catch (IOException | IllegalArgumentException e) { 154 158 // if we fail to submit the job, mark tile as loaded and set error message 155 159 Main.warn(e, false); -
trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java
r11553 r11559 11 11 import java.nio.charset.StandardCharsets; 12 12 import java.util.ArrayList; 13 import java.util.Arrays; 13 14 import java.util.Collection; 14 15 import java.util.Collections; … … 17 18 import java.util.Map; 18 19 import java.util.Map.Entry; 20 import java.util.Objects; 19 21 import java.util.Optional; 20 22 import java.util.Set; … … 27 29 import java.util.stream.Collectors; 28 30 31 import javax.imageio.ImageIO; 29 32 import javax.swing.JPanel; 30 33 import javax.swing.JScrollPane; … … 148 151 149 152 Layer(Layer l) { 150 if (l != null) { 151 format = l.format; 152 name = l.name; 153 baseUrl = l.baseUrl; 154 style = l.style; 155 tileMatrixSet = new TileMatrixSet(l.tileMatrixSet); 156 } 153 Objects.requireNonNull(l); 154 format = l.format; 155 name = l.name; 156 baseUrl = l.baseUrl; 157 style = l.style; 158 tileMatrixSet = new TileMatrixSet(l.tileMatrixSet); 157 159 } 158 160 … … 384 386 Layer layer = new Layer(); 385 387 Stack<QName> tagStack = new Stack<>(); 388 List<String> supportedMimeTypes = Arrays.asList(ImageIO.getReaderMIMETypes()); 386 389 387 390 for (int event = reader.getEventType(); … … 392 395 if (tagStack.size() == 2) { 393 396 if (QN_FORMAT.equals(reader.getName())) { 394 layer.format = reader.getElementText(); 397 String format = reader.getElementText(); 398 if (supportedMimeTypes.contains(format)) { 399 layer.format = format; 400 } 395 401 } else if (GetCapabilitiesParseHelper.QN_OWS_IDENTIFIER.equals(reader.getName())) { 396 402 layer.name = reader.getElementText();
Note:
See TracChangeset
for help on using the changeset viewer.